From: Eric Biggers Date: Tue, 24 Mar 2015 01:47:38 +0000 (-0500) Subject: blob_table.c: fix NTFS location clone error path X-Git-Tag: v1.8.1~69 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=c8973198f13d77027bf601b5ec206baca2e7fa34 blob_table.c: fix NTFS location clone error path --- diff --git a/src/blob_table.c b/src/blob_table.c index 5551c163..84835b5a 100644 --- a/src/blob_table.c +++ b/src/blob_table.c @@ -149,19 +149,18 @@ clone_blob_descriptor(const struct blob_descriptor *old) #ifdef WITH_NTFS_3G case BLOB_IN_NTFS_VOLUME: if (old->ntfs_loc) { - struct ntfs_location *loc; - loc = memdup(old->ntfs_loc, sizeof(struct ntfs_location)); - if (loc == NULL) + new->ntfs_loc = memdup(old->ntfs_loc, + sizeof(struct ntfs_location)); + if (new->ntfs_loc == NULL) goto out_free; - loc->path = NULL; - loc->attr_name = NULL; - new->ntfs_loc = loc; - loc->path = STRDUP(old->ntfs_loc->path); - if (loc->path == NULL) + new->ntfs_loc->path = STRDUP(old->ntfs_loc->path); + new->ntfs_loc->attr_name = NULL; + if (new->ntfs_loc->path == NULL) goto out_free; - if (loc->attr_name_nchars != 0) { - loc->attr_name = utf16le_dup(old->ntfs_loc->attr_name); - if (loc->attr_name == NULL) + if (new->ntfs_loc->attr_name_nchars != 0) { + new->ntfs_loc->attr_name = + utf16le_dup(old->ntfs_loc->attr_name); + if (new->ntfs_loc->attr_name == NULL) goto out_free; } }