diff options
author | Andreas Schneider <asn@samba.org> | 2021-12-10 15:03:20 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-12-15 19:32:30 +0000 |
commit | e8e1a74da3f5ba4850a6f4ad8b54ea2ac5703710 (patch) | |
tree | bd99e75ea6ed30a6f1cc83f40a5559f577bc7cd8 /source3/lib/netapi | |
parent | 9bd0fbf5e8d2e4cf65d5d26311a8b510eef3eba5 (diff) | |
download | samba-e8e1a74da3f5ba4850a6f4ad8b54ea2ac5703710.tar.gz |
s3:lib: Do not close fd = -1 on fail in netapi example
Signed-off-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 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/netapi/examples/common.c b/source3/lib/netapi/examples/common.c index 997144a34e2..66b2bd3b6d0 100644 --- a/source3/lib/netapi/examples/common.c +++ b/source3/lib/netapi/examples/common.c @@ -167,7 +167,9 @@ char *netapi_read_file(const char *filename, uint32_t *psize) if (file != NULL) { fclose(file); } - close(fd); + if (fd >= 0) { + close(fd); + } return p; } |