summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-29 17:27:47 -0800
committerJeremy Allison <jra@samba.org>2009-01-29 17:27:47 -0800
commit734647bd85560ed02691d79c0a613543043d8625 (patch)
tree7c094078b4007fa30bde6e484b1441208823e92a /source3/libnet
parent77bac5b78c10d816e02a8a407b0a4653d72868a0 (diff)
downloadsamba-734647bd85560ed02691d79c0a613543043d8625.tar.gz
samba-734647bd85560ed02691d79c0a613543043d8625.tar.bz2
samba-734647bd85560ed02691d79c0a613543043d8625.zip
Fix coverity CID#115. Resource leak in error path.
Jeremy.
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_samsync_ldif.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/libnet/libnet_samsync_ldif.c b/source3/libnet/libnet_samsync_ldif.c
index 3068f8d3eb..4286331893 100644
--- a/source3/libnet/libnet_samsync_ldif.c
+++ b/source3/libnet/libnet_samsync_ldif.c
@@ -776,7 +776,10 @@ static NTSTATUS fetch_alias_info_to_ldif(TALLOC_CTX *mem_ctx,
g_rid = r->rid;
groupmap->gidNumber = ldif_gid;
groupmap->sambaSID = talloc_asprintf(mem_ctx, "%s-%d", sid, g_rid);
- NT_STATUS_HAVE_NO_MEMORY(groupmap->sambaSID);
+ if (groupmap->sambaSID == NULL) {
+ SAFE_FREE(group_attr);
+ return NT_STATUS_NO_MEMORY;
+ }
/* Write the data to the temporary add ldif file */
fprintf(add_fd, "# %s, %s, %s\n", aliasname, group_attr,