r19078: talloc_strdup can fail
authorVolker Lendecke <vlendec@samba.org>
Wed, 4 Oct 2006 20:51:17 +0000 (20:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:15:09 +0000 (12:15 -0500)
(This used to be commit 2b3b9ce2a122ec5fd945728c117c321087d85203)

source3/locking/locking.c

index 371f1b474c0c73425c7fb40381ea0e78afdadd17..fbe22f4e1dade72aba1bab04d9fd757abeb3a3d2 100644 (file)
@@ -562,12 +562,18 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                                        (lck->num_share_modes *
                                        sizeof(struct share_mode_entry)) +
                                        data->u.s.delete_token_size );
+       if (lck->servicepath == NULL) {
+               smb_panic("talloc_strdup failed\n");
+       }
 
        lck->filename = talloc_strdup(lck, dbuf.dptr + sizeof(*data) +
                                        (lck->num_share_modes *
                                        sizeof(struct share_mode_entry)) +
                                        data->u.s.delete_token_size +
                                        strlen(lck->servicepath) + 1 );
+       if (lck->filename == NULL) {
+               smb_panic("talloc_strdup failed\n");
+       }
 
        /*
         * Ensure that each entry has a real process attached.