summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-02-01 01:08:19 +0100
committerGravatar Nikias Bassen2013-02-01 01:08:19 +0100
commit6370bf5477692ca434ca388ba1bf37ed6be7d123 (patch)
tree037dd6d57d3cb9dd41c44f82869c2e509ecd7753 /tools/idevicebackup2.c
parent1eff94c02a2f72debb73d2983724c193e42fd9d4 (diff)
downloadlibimobiledevice-6370bf5477692ca434ca388ba1bf37ed6be7d123.tar.gz
libimobiledevice-6370bf5477692ca434ca388ba1bf37ed6be7d123.tar.bz2
idevicebackup2: fix invalid free in mkdir_with_parents
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 0426d43..8f094c8 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -197,9 +197,9 @@ static int mkdir_with_parents(const char *dir, int mode)
}
int res;
char *parent = strdup(dir);
- parent = dirname(parent);
- if (parent) {
- res = mkdir_with_parents(parent, mode);
+ char *parentdir = dirname(parent);
+ if (parentdir) {
+ res = mkdir_with_parents(parentdir, mode);
} else {
res = -1;
}