summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/commands.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/commands.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/commands.c')
-rw-r--r--sys/boot/common/commands.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c
index 00b93d8..cc75032 100644
--- a/sys/boot/common/commands.c
+++ b/sys/boot/common/commands.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: commands.c,v 1.9 1999/01/11 06:41:31 msmith Exp $
+ * $Id: commands.c,v 1.10 1999/02/01 06:08:20 jkh Exp $
*/
#include <stand.h>
@@ -192,8 +192,14 @@ command_help(int argc, char *argv[])
close(hfd);
if (!matched) {
sprintf(command_errbuf, "no help available for '%s'", topic);
+ free(topic);
+ if (subtopic)
+ free(subtopic);
return(CMD_ERROR);
}
+ free(topic);
+ if (subtopic)
+ free(subtopic);
return(CMD_OK);
}
OpenPOWER on IntegriCloud