aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-16 11:17:37 +0100
committerGitHub <noreply@github.com>2019-01-16 11:17:37 +0100
commitb3abe2c28941143d520e03c581b0ee3c3fafc087 (patch)
tree9d93afcde6a205b5e62d1268968fcb9c2f76ac5c
parent81e94c9049addbbdd47bec6ea99691daee942ecd (diff)
parent0abb757425af993ba9acae7602d739ef83963a7f (diff)
downloadpodman-b3abe2c28941143d520e03c581b0ee3c3fafc087.tar.gz
podman-b3abe2c28941143d520e03c581b0ee3c3fafc087.tar.bz2
podman-b3abe2c28941143d520e03c581b0ee3c3fafc087.zip
Merge pull request #2163 from rhatdan/coverity
Cleanup coverity scan issues
-rw-r--r--pkg/rootless/rootless_linux.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c
index 1d28ff68d..279a03d3f 100644
--- a/pkg/rootless/rootless_linux.c
+++ b/pkg/rootless/rootless_linux.c
@@ -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);