1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

Fix coredump and memory leak for 'dmsetup help -c'

This commit is contained in:
Zdenek Kabelac 2009-12-11 13:04:30 +00:00
parent 2df53fc3d0
commit c8d8f74188

View File

@ -2402,7 +2402,7 @@ static int _report_init(struct command *c)
size_t len = 0;
int r = 0;
if (!strcmp(c->name, "splitname"))
if (c && !strcmp(c->name, "splitname"))
options = (char *) splitname_report_options;
/* emulate old dmsetup behaviour */
@ -2592,6 +2592,10 @@ static int _help(int argc __attribute((unused)),
_string_args[OPTIONS_ARG] = (char *) "help";
_switches[SORT_ARG] = 0;
if (_report) {
dm_report_free(_report);
_report = NULL;
}
(void) _report_init(NULL);
}