diff --git a/lib/idmapping.c b/lib/idmapping.c index 5c2fe5d3..adc61af8 100644 --- a/lib/idmapping.c +++ b/lib/idmapping.c @@ -46,25 +46,21 @@ get_map_ranges(int ranges, int argc, char **argv) if (!mappings) { fprintf(log_get_logfd(), _( "%s: Memory allocation failure\n"), log_get_progname()); - exit(EXIT_FAILURE); + return NULL; } /* Gather up the ranges from the command line */ m = mappings; for (int i = 0; i < ranges * 3; i+=3, m++) { if (a2ul(&m->upper, argv[i + 0], NULL, 0, 0, UINT_MAX) == -1) { - if (errno == ERANGE) { + if (errno == ERANGE) fprintf(log_get_logfd(), _( "%s: subuid overflow detected.\n"), log_get_progname()); - exit(EXIT_FAILURE); - } free(mappings); return NULL; } if (a2ul(&m->lower, argv[i + 1], NULL, 0, 0, UINT_MAX) == -1) { - if (errno == ERANGE) { + if (errno == ERANGE) fprintf(log_get_logfd(), _( "%s: subuid overflow detected.\n"), log_get_progname()); - exit(EXIT_FAILURE); - } free(mappings); return NULL; } @@ -73,10 +69,8 @@ get_map_ranges(int ranges, int argc, char **argv) MIN(UINT_MAX, ULONG_MAX - 1) - m->upper)) == -1) { - if (errno == ERANGE) { + if (errno == ERANGE) fprintf(log_get_logfd(), _( "%s: subuid overflow detected.\n"), log_get_progname()); - exit(EXIT_FAILURE); - } free(mappings); return NULL; }