summaryrefslogtreecommitdiffstats
path: root/src/ifuse.c
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-12 21:47:01 +0200
committerGravatar Jonathan Beck2008-08-21 18:47:04 +0200
commita885ca9dbe929781144f3f1a00e565dfa31f68c6 (patch)
tree6ccec69d5dfc45d341ca85d24a7ad80d2f558652 /src/ifuse.c
parente5e5f21cae73230eaaa70273bd4400ff6b86641a (diff)
downloadlibimobiledevice-a885ca9dbe929781144f3f1a00e565dfa31f68c6.tar.gz
libimobiledevice-a885ca9dbe929781144f3f1a00e565dfa31f68c6.tar.bz2
Don't leak memory in error cases in ifuse_init
Diffstat (limited to 'src/ifuse.c')
-rw-r--r--src/ifuse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index 7ae4827..2a33405 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -197,12 +197,15 @@ void *ifuse_init(struct fuse_conn_info *conn) {
197 } 197 }
198 198
199 if (!lockdownd_init(phone, &control)) { 199 if (!lockdownd_init(phone, &control)) {
200 free_iPhone(phone);
200 fprintf(stderr, "Something went wrong in the lockdownd client.\n"); 201 fprintf(stderr, "Something went wrong in the lockdownd client.\n");
201 return NULL; 202 return NULL;
202 } 203 }
203 204
204 port = lockdownd_start_service(control, "com.apple.afc"); 205 port = lockdownd_start_service(control, "com.apple.afc");
205 if (!port) { 206 if (!port) {
207 lockdownd_close(control);
208 free_iphone(phone);
206 fprintf(stderr, "Something went wrong when starting AFC."); 209 fprintf(stderr, "Something went wrong when starting AFC.");
207 return NULL; 210 return NULL;
208 } 211 }