Commit a885ca9d authored by Christophe Fergeau's avatar Christophe Fergeau Committed by Jonathan Beck

Don't leak memory in error cases in ifuse_init

parent e5e5f21c
...@@ -197,12 +197,15 @@ void *ifuse_init(struct fuse_conn_info *conn) { ...@@ -197,12 +197,15 @@ void *ifuse_init(struct fuse_conn_info *conn) {
} }
if (!lockdownd_init(phone, &control)) { if (!lockdownd_init(phone, &control)) {
free_iPhone(phone);
fprintf(stderr, "Something went wrong in the lockdownd client.\n"); fprintf(stderr, "Something went wrong in the lockdownd client.\n");
return NULL; return NULL;
} }
port = lockdownd_start_service(control, "com.apple.afc"); port = lockdownd_start_service(control, "com.apple.afc");
if (!port) { if (!port) {
lockdownd_close(control);
free_iphone(phone);
fprintf(stderr, "Something went wrong when starting AFC."); fprintf(stderr, "Something went wrong when starting AFC.");
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment