diff options
author | Pavel Filipenský <pfilipen@redhat.com> | 2022-05-23 12:57:42 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-05-23 18:25:28 +0000 |
commit | 3bb6b05781fa79de697d859d18c4fc252831fdef (patch) | |
tree | 4af57eb87322ed064b59334a3c5a00e722200d50 /source3/lib/netapi | |
parent | d19dfe1efb2f6cb0dcf0a63b957df584d8ed5945 (diff) | |
download | samba-3bb6b05781fa79de697d859d18c4fc252831fdef.tar.gz |
s3:lib: Fix use_after_free: Using freed pointer "p"
Found by covscan.
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r-- | source3/lib/netapi/examples/common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/lib/netapi/examples/common.c b/source3/lib/netapi/examples/common.c index 66b2bd3b6d0..72d7150b4ea 100644 --- a/source3/lib/netapi/examples/common.c +++ b/source3/lib/netapi/examples/common.c @@ -140,6 +140,7 @@ char *netapi_read_file(const char *filename, uint32_t *psize) tmp = realloc(p, sizeof(char) * newbufsize); if (tmp == NULL) { free(p); + p = NULL; goto fail; } p = tmp; |