Skip to content

Commit 16201d5

Browse files
Vinit Agnihotrigd
authored andcommitted
s3:lib: Fix CID 1497484 use-after-free.
p was not set to NULL after being free'd, this can cause a use-after-free situation. This fixes coverity issue#1497484 Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jul 29 15:01:42 UTC 2025 on atb-devel-224
1 parent 33b5522 commit 16201d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source3/lib/netapi/examples/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ char *netapi_read_file(const char *filename, uint32_t *psize)
156156
err = ferror(file);
157157
if (err != 0) {
158158
free(p);
159+
p = NULL;
159160
goto fail;
160161
}
161162

0 commit comments

Comments
 (0)