summaryrefslogtreecommitdiff
path: root/source3/locking/locking.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-23 02:52:38 +0000
committerJeremy Allison <jra@samba.org>2002-11-23 02:52:38 +0000
commitf023d6129b7bf0d972f2bb9ecc025d316e55c8ae (patch)
tree753324d5e143411d4859ec5bb969ff98dfeba320 /source3/locking/locking.c
parent823f8507cb209235e2efc7e19870c5d55b776d4d (diff)
downloadsamba-f023d6129b7bf0d972f2bb9ecc025d316e55c8ae.tar.gz
samba-f023d6129b7bf0d972f2bb9ecc025d316e55c8ae.tar.bz2
samba-f023d6129b7bf0d972f2bb9ecc025d316e55c8ae.zip
Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>. Jeremy. (This used to be commit 19f86f1f72aca924e9e320e20a175b5d21de45ad)
Diffstat (limited to 'source3/locking/locking.c')
-rw-r--r--source3/locking/locking.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 3eb7ca4783..e8b6f3428f 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -652,8 +652,10 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type)
size = dbuf.dsize + sizeof(share_mode_entry);
p = malloc(size);
- if (!p)
+ if (!p) {
+ SAFE_FREE(dbuf.dptr);
return False;
+ }
memcpy(p, dbuf.dptr, sizeof(*data));
fill_share_mode(p + sizeof(*data), fsp, port, op_type);
memcpy(p + sizeof(*data) + sizeof(share_mode_entry), dbuf.dptr + sizeof(*data),