diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-16 11:17:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-16 11:17:37 +0100 |
commit | b3abe2c28941143d520e03c581b0ee3c3fafc087 (patch) | |
tree | 9d93afcde6a205b5e62d1268968fcb9c2f76ac5c | |
parent | 81e94c9049addbbdd47bec6ea99691daee942ecd (diff) | |
parent | 0abb757425af993ba9acae7602d739ef83963a7f (diff) | |
download | podman-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.c | 9 |
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); |