diff options
author | Aaron Burghardt | 2013-07-12 17:55:58 +0200 |
---|---|---|
committer | Nikias Bassen | 2013-07-12 17:55:58 +0200 |
commit | f8065b26df76f9057e2d42db8bd1c68825f222c6 (patch) | |
tree | bd421dd6001b2edddb248e351bb281a2760bb56a /libusbmuxd | |
parent | 6f6484fb4565cb7378f610d736ea8263652f67c5 (diff) | |
download | usbmuxd-f8065b26df76f9057e2d42db8bd1c68825f222c6.tar.gz usbmuxd-f8065b26df76f9057e2d42db8bd1c68825f222c6.tar.bz2 |
libusbmuxd: fix memory leak when receiving plist packets
Diffstat (limited to 'libusbmuxd')
-rw-r--r-- | libusbmuxd/libusbmuxd.c | 3 |
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 |