r15608: Fix a couple of Coverity errors
authorVolker Lendecke <vlendec@samba.org>
Mon, 15 May 2006 03:51:45 +0000 (03:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:17:03 +0000 (11:17 -0500)
source/utils/net_rpc_samsync.c

index d13d5b1cb3fda76e333b58b47132cec4fa6749d0..ef9a0627b589e9a12bf7a33d3ac99bc35d38044d 100644 (file)
@@ -1043,6 +1043,7 @@ static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const ch
 
        user_suffix = lp_ldap_user_suffix();
        if (user_suffix == NULL) {
+               SAFE_FREE(suffix_attr);
                return NT_STATUS_NO_MEMORY;
        }
        /* If it exists and is distinct from other containers, 
@@ -1060,6 +1061,8 @@ static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const ch
 
        group_suffix = lp_ldap_group_suffix();
        if (group_suffix == NULL) {
+               SAFE_FREE(suffix_attr);
+               SAFE_FREE(user_attr);
                return NT_STATUS_NO_MEMORY;
        }
        /* If it exists and is distinct from other containers, 
@@ -1078,6 +1081,9 @@ static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const ch
           Write the Computers entity */
        machine_suffix = lp_ldap_machine_suffix();
        if (machine_suffix == NULL) {
+               SAFE_FREE(suffix_attr);
+               SAFE_FREE(user_attr);
+               SAFE_FREE(group_attr);
                return NT_STATUS_NO_MEMORY;
        }
        if (*machine_suffix && strcmp(machine_suffix, user_suffix) &&
@@ -1099,6 +1105,9 @@ static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const ch
           Write the IdMap entity */
        idmap_suffix = lp_ldap_idmap_suffix();
        if (idmap_suffix == NULL) {
+               SAFE_FREE(suffix_attr);
+               SAFE_FREE(user_attr);
+               SAFE_FREE(group_attr);
                return NT_STATUS_NO_MEMORY;
        }
        if (*idmap_suffix &&