Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst David Binderman in PR bin/50713: fix memory...
details: https://anonhg.NetBSD.org/src/rev/d8b27cf86f91
branches: trunk
changeset: 343243:d8b27cf86f91
user: martin <martin%NetBSD.org@localhost>
date: Tue Jan 26 14:05:29 2016 +0000
description:
David Binderman in PR bin/50713: fix memory leaks
diffstat:
usr.sbin/sysinst/disks.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (43 lines):
diff -r 0e922dacae2c -r d8b27cf86f91 usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c Tue Jan 26 06:27:38 2016 +0000
+++ b/usr.sbin/sysinst/disks.c Tue Jan 26 14:05:29 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.11 2015/11/14 23:00:17 pgoyette Exp $ */
+/* $NetBSD: disks.c,v 1.12 2016/01/26 14:05:29 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -800,8 +800,11 @@
error = fsck_preen(pm->diskdev, ptn, lbl->fsname);
}
free(newfs);
- if (error != 0)
+ if (error != 0) {
+ free(devdev);
+ free(dev);
return error;
+ }
lbl->pi_flags ^= PIF_NEWFS;
md_pre_mount();
@@ -813,6 +816,8 @@
if (error) {
msg_display(MSG_mountfail, dev, ' ', lbl->pi_mount);
process_menu(MENU_ok, NULL);
+ free(devdev);
+ free(dev);
return error;
}
}
@@ -1055,8 +1060,10 @@
asprintf(&prog, "/sbin/fsck_%s", fsname);
if (prog == NULL)
return 0;
- if (access(prog, X_OK) != 0)
+ if (access(prog, X_OK) != 0) {
+ free(prog);
return 0;
+ }
if (!strcmp(fsname,"ffs"))
fixsb(prog, disk, ptn);
error = run_program(0, "%s -p -q /dev/r%s%c", prog, disk, ptn);
Home |
Main Index |
Thread Index |
Old Index