Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/gpt CID 1341564: Arg memory leak
details: https://anonhg.NetBSD.org/src/rev/3ecec1a6fcb9
branches: trunk
changeset: 342049:3ecec1a6fcb9
user: christos <christos%NetBSD.org@localhost>
date: Thu Dec 03 21:51:02 2015 +0000
description:
CID 1341564: Arg memory leak
diffstat:
sbin/gpt/label.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r 2856660e52cb -r 3ecec1a6fcb9 sbin/gpt/label.c
--- a/sbin/gpt/label.c Thu Dec 03 21:49:51 2015 +0000
+++ b/sbin/gpt/label.c Thu Dec 03 21:51:02 2015 +0000
@@ -33,7 +33,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/label.c,v 1.3 2006/10/04 18:20:25 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: label.c,v 1.26 2015/12/03 21:48:12 christos Exp $");
+__RCSID("$NetBSD: label.c,v 1.27 2015/12/03 21:51:02 christos Exp $");
#endif
#include <sys/types.h>
@@ -135,21 +135,24 @@
switch(ch) {
case 'f':
if (name_from_file(gpt, &name) == -1)
- return usage();
+ goto usage;
break;
case 'l':
if (gpt_name_get(gpt, &name) == -1)
- return usage();
+ goto usage;
break;
default:
if (gpt_add_find(gpt, &find, ch) == -1)
- return usage();
+ goto usage;
break;
}
}
if (name == NULL || argc != optind)
- return usage();
+ goto usage;
return gpt_change_ent(gpt, &find, change, name);
+usage:
+ free(name);
+ return -1;
}
Home |
Main Index |
Thread Index |
Old Index