Fix a resource leak in libmis/idmapping.c
Reported at https://alioth.debian.org/tracker/?func=detail&atid=411478&aid=315136&group_id=30580 by Alejandro Joya. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
acf11efe54
commit
7edb32e75f
@ -71,12 +71,18 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
|
|||||||
/* Gather up the ranges from the command line */
|
/* Gather up the ranges from the command line */
|
||||||
mapping = mappings;
|
mapping = mappings;
|
||||||
for (idx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
|
for (idx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
|
||||||
if (!getulong(argv[argidx + 0], &mapping->upper))
|
if (!getulong(argv[argidx + 0], &mapping->upper)) {
|
||||||
|
free(mappings);
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!getulong(argv[argidx + 1], &mapping->lower))
|
}
|
||||||
|
if (!getulong(argv[argidx + 1], &mapping->lower)) {
|
||||||
|
free(mappings);
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!getulong(argv[argidx + 2], &mapping->count))
|
}
|
||||||
|
if (!getulong(argv[argidx + 2], &mapping->count)) {
|
||||||
|
free(mappings);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return mappings;
|
return mappings;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user