r22589: Make TALLOC_ARRAY consistent across all uses.
[abartlet/samba.git/.git] / source3 / libmsrpc / libmsrpc_internal.c
index 64e6332e804a2b27118ce01c5ea9d240077a05cc..3cb702e376759bd422ff123d1e7d684bcfafe1f4 100644 (file)
@@ -299,12 +299,16 @@ REG_VALUE_DATA *cac_MakeRegValueData( TALLOC_CTX * mem_ctx, uint32 data_type,
                                break;
                }
 
-               strings = TALLOC_ARRAY( mem_ctx, char *, num_strings );
+               if (num_strings) {
+                       strings = TALLOC_ARRAY( mem_ctx, char *, num_strings );
 
-               if ( !strings ) {
-                       errno = ENOMEM;
-                       TALLOC_FREE( data );
-                       break;
+                       if ( !strings ) {
+                               errno = ENOMEM;
+                               TALLOC_FREE( data );
+                               break;
+                       }
+               } else {
+                       strings = NULL;
                }
 
                if ( num_strings == 0 ) /*then our work here is done */