Merge pull request #9 from shadow-maint/idmapleak

Idmapleak
This commit is contained in:
Serge Hallyn 2015-11-12 23:03:09 -06:00
commit 4c4896f0d5

View File

@ -70,13 +70,19 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
/* Gather up the ranges from the command line */
mapping = mappings;
for (idx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
if (!getulong(argv[argidx + 0], &mapping->upper))
for (idx = 0, argidx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
if (!getulong(argv[argidx + 0], &mapping->upper)) {
free(mappings);
return NULL;
if (!getulong(argv[argidx + 1], &mapping->lower))
}
if (!getulong(argv[argidx + 1], &mapping->lower)) {
free(mappings);
return NULL;
if (!getulong(argv[argidx + 2], &mapping->count))
}
if (!getulong(argv[argidx + 2], &mapping->count)) {
free(mappings);
return NULL;
}
}
return mappings;
}