Do not talloc_strdup filename and servicepath
authorVolker Lendecke <vl@samba.org>
Mon, 7 Jan 2008 11:57:10 +0000 (12:57 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 7 Jan 2008 20:18:20 +0000 (21:18 +0100)
source/locking/locking.c

index 270c6d22610a092ed8d6e087da429c795790c25c..2ec8cd29386d404cc8dc426ab065951c8caa3d8b 100644 (file)
@@ -585,22 +585,14 @@ static bool parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
        }
 
        /* Save off the associated service path and filename. */
-       lck->servicepath = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) +
-                                       (lck->num_share_modes *
-                                       sizeof(struct share_mode_entry)) +
-                                       data->u.s.delete_token_size );
-       if (lck->servicepath == NULL) {
-               smb_panic("parse_share_modes: talloc_strdup failed");
-       }
-
-       lck->filename = talloc_strdup(lck, (const char *)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("parse_share_modes: talloc_strdup failed");
-       }
+       lck->servicepath = (const char *)dbuf.dptr + sizeof(*data) +
+               (lck->num_share_modes * sizeof(struct share_mode_entry)) +
+               data->u.s.delete_token_size;
+
+       lck->filename = (const char *)dbuf.dptr + sizeof(*data) +
+               (lck->num_share_modes * sizeof(struct share_mode_entry)) +
+               data->u.s.delete_token_size +
+               strlen(lck->servicepath) + 1;
 
        /*
         * Ensure that each entry has a real process attached.