summaryrefslogtreecommitdiffstats
path: root/libusbmuxd
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2013-07-12 17:55:58 +0200
committerGravatar Nikias Bassen2013-07-12 17:55:58 +0200
commitf8065b26df76f9057e2d42db8bd1c68825f222c6 (patch)
treebd421dd6001b2edddb248e351bb281a2760bb56a /libusbmuxd
parent6f6484fb4565cb7378f610d736ea8263652f67c5 (diff)
downloadusbmuxd-f8065b26df76f9057e2d42db8bd1c68825f222c6.tar.gz
usbmuxd-f8065b26df76f9057e2d42db8bd1c68825f222c6.tar.bz2
libusbmuxd: fix memory leak when receiving plist packets
Diffstat (limited to 'libusbmuxd')
-rw-r--r--libusbmuxd/libusbmuxd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c
index 956dd90..31d1c7c 100644
--- a/libusbmuxd/libusbmuxd.c
+++ b/libusbmuxd/libusbmuxd.c
@@ -181,6 +181,7 @@ static int receive_packet(int sfd, struct usbmuxd_header *header, void **payload
plist_t props = plist_dict_get_item(plist, "Properties");
if (!props) {
DEBUG(1, "%s: Could not get properties for message '%s' from plist!\n", __func__, message);
+ free(message);
plist_free(plist);
return -EBADMSG;
}
@@ -222,9 +223,11 @@ static int receive_packet(int sfd, struct usbmuxd_header *header, void **payload
}
} else {
DEBUG(1, "%s: Unexpected message '%s' in plist!\n", __func__, message);
+ free(message);
plist_free(plist);
return -EBADMSG;
}
+ free(message);
}
plist_free(plist);
} else