Add a check for talloc failure. - Pointed out by Volker.
authorMichael Adam <obnox@samba.org>
Mon, 21 Jan 2008 14:24:23 +0000 (15:24 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 21 Jan 2008 21:49:45 +0000 (22:49 +0100)
Michael
(This used to be commit bdc49b07cc6de36c9319254a131858c9a7f9dd53)

source3/libnet/libnet_conf.c

index d20e10b14168c7e348565fdebd1281af958d5ab9..152148300e74301d0dd764e0d6de55dc4c905b06 100644 (file)
@@ -48,6 +48,10 @@ static WERROR libnet_conf_add_string_to_array(TALLOC_CTX *mem_ctx,
        }
 
        new_array[count] = talloc_strdup(new_array, string);
+       if (new_array[count] == NULL) {
+               TALLOC_FREE(new_array);
+               return WERR_NOMEM;
+       }
 
        *array = new_array;