summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/interp_parse.c
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>1999-03-08 10:32:39 +0000
committerdcs <dcs@FreeBSD.org>1999-03-08 10:32:39 +0000
commit304195a1776cf0370224c99f3635cc9a5a7f24c6 (patch)
tree9ad1bab2e42bdd484b98f2b1f3e51e51ba1bfa0a /sys/boot/common/interp_parse.c
parent118d31f1ddfe1bde113487c8a95dfba5da8276b1 (diff)
downloadFreeBSD-src-304195a1776cf0370224c99f3635cc9a5a7f24c6.zip
FreeBSD-src-304195a1776cf0370224c99f3635cc9a5a7f24c6.tar.gz
Fix a number of memory leaks and other memory-related disorders.
Also, unbreak the breakage introduced at the last revision of module.c. This changes the semantics of mod_searchfile() (and mod_searchmodule()) to make the caller's responsibility freeing the buffer returned. This is different from other functions in loader's code, and was done as a fix for kern/9631. If someone wants to revert this to the original behavior, don't forget to fix kern/9631 in another way. This should also fix bin/10462, which was introduced as a result of the first try at kern/9631 (module.c last revision). PR: bin/10462 Submitted by: Takanori Saneto <sanewo@ba2.so-net.ne.jp>
Diffstat (limited to 'sys/boot/common/interp_parse.c')
-rw-r--r--sys/boot/common/interp_parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/boot/common/interp_parse.c b/sys/boot/common/interp_parse.c
index 865c8cb..6c38710 100644
--- a/sys/boot/common/interp_parse.c
+++ b/sys/boot/common/interp_parse.c
@@ -11,7 +11,7 @@
* Jordan K. Hubbard
* 29 August 1998
*
- * $Id: interp_parse.c,v 1.5 1999/01/10 05:08:12 msmith Exp $
+ * $Id: interp_parse.c,v 1.6 1999/01/13 08:11:41 msmith Exp $
*
* The meat of the simple parser.
*/
@@ -167,6 +167,7 @@ parse(int *argc, char ***argv, char *str)
*argc = ac;
*argv = (char **)malloc((sizeof(char *) * ac + 1));
bcopy(args, *argv, sizeof(char *) * ac + 1);
+ free(buf);
free(copy);
return 0;
}
OpenPOWER on IntegriCloud