summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-11-02 08:39:17 +0100
committerAndrew Bartlett <abartlet@samba.org>2012-11-16 23:28:21 +0100
commit3925a7114caaac56e79849ebf3aa13784918282b (patch)
treefae09e316d7d55ccf04a88d5df8d26cd21bfcd0e
parent10b6cceb1f0f09c7a8f5fc8882fdc3852d11951f (diff)
downloadsamba-3925a7114caaac56e79849ebf3aa13784918282b.tar.gz
samba-3925a7114caaac56e79849ebf3aa13784918282b.tar.xz
samba-3925a7114caaac56e79849ebf3aa13784918282b.zip
s3:vfs_gpfs fix memory leaks in gpfs_getacl_alloc
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source3/modules/vfs_gpfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 8e8c69455e..edf0273711 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -242,6 +242,7 @@ static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type
struct gpfs_acl *new_acl = (struct gpfs_acl *)TALLOC_SIZE(
mem_ctx, acl->acl_len + sizeof(struct gpfs_acl));
if (new_acl == NULL) {
+ talloc_free(acl);
errno = ENOMEM;
return NULL;
}
@@ -250,13 +251,14 @@ static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type
new_acl->acl_level = acl->acl_level;
new_acl->acl_version = acl->acl_version;
new_acl->acl_type = acl->acl_type;
+ talloc_free(acl);
acl = new_acl;
ret = smbd_gpfs_getacl((char *)fname, GPFS_GETACL_STRUCT, acl);
}
- if (ret != 0)
- {
+ if (ret != 0) {
DEBUG(8, ("smbd_gpfs_getacl failed with %s\n",strerror(errno)));
+ talloc_free(acl);
return NULL;
}