diff options
Diffstat (limited to 'source3/locking/locking.c')
-rw-r--r-- | source3/locking/locking.c | 4 |
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), |