Merge pull request #2163 from rhatdan/coverity

Cleanup coverity scan issues
This commit is contained in:
OpenShift Merge Robot
2019-01-16 11:17:37 +01:00
committed by GitHub

View File

@ -70,9 +70,12 @@ get_cmd_line_args (pid_t pid)
if (allocated == used)
{
allocated += 512;
buffer = realloc (buffer, allocated);
if (buffer == NULL)
return NULL;
char *tmp = realloc (buffer, allocated);
if (buffer == NULL) {
free(buffer);
return NULL;
}
buffer=tmp;
}
}
close (fd);