r17047: Fix a typo and a possible NULL dereference
authorVolker Lendecke <vlendec@samba.org>
Sat, 15 Jul 2006 08:36:44 +0000 (08:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:19:22 +0000 (11:19 -0500)
source/registry/reg_db.c

index 5484c238b60d7f0b945b4b6303fa36f619f350fb..d73b27521d46efd09755182f1a70a45fc929a21a 100644 (file)
@@ -229,7 +229,7 @@ BOOL regdb_init( void )
        /* always setup the necessary keys and values */
 
        if ( !init_registry_data() ) {
-               DEBUG(0,("init_registry: Failed to initiailize data in registry!\n"));
+               DEBUG(0,("init_registry: Failed to initialize data in registry!\n"));
                return False;
        }
 
@@ -313,7 +313,9 @@ static BOOL regdb_store_keys_internal( const char *key, REGSUBKEY_CTR *ctr )
 
        /* allocate some initial memory */
                
-       buffer = SMB_MALLOC(sizeof(pstring));
+       if (!(buffer = SMB_MALLOC(sizeof(pstring)))) {
+               return False;
+       }
        buflen = sizeof(pstring);
        len = 0;