r14150: Fix coverity #118: not freeing alloc'ed storage returned from
authorJim McDonough <jmcd@samba.org>
Fri, 10 Mar 2006 14:09:34 +0000 (14:09 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:14 +0000 (11:15 -0500)
sstring_sub().
(This used to be commit 6ff849f35ae3394d6557f79c73b0fe54fbb86d0f)

source3/utils/net_rpc_samsync.c

index 5ee0b702781995fdfbdd11982a3f313ad6a152d0..2c2ffbe6f036da1fba90d53bec8f24527ad366b3 100644 (file)
@@ -1309,7 +1309,9 @@ static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const ch
        fflush(add_fd);
 
        /* Deallocate memory, and return */
-       if (suffix_attr != NULL) SAFE_FREE(suffix_attr);
+       SAFE_FREE(suffix_attr);
+       SAFE_FREE(user_attr);
+       SAFE_FREE(group_attr);
        return NT_STATUS_OK;
 }