For some command line flags, the argument string is copied. Simply
writing over the buffer leads to a resource leak if the same flag
is specified on the command line more than once.
This patch adds a free() call to the old buffer before overwriting
it with the new copy.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
switch (opt) {
case 'r':
case 'd':
+ free(root);
root_len = strlen(optarg);
root = xmalloc(root_len + 2);
do_create_inum_attr = 1;
break;
case 's':
+ free(context);
context_len = strlen(optarg);
context = (char *) xmalloc(context_len + 1);
if (!context)