summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-12 21:54:58 +0200
committerGravatar Jonathan Beck2008-08-21 18:51:02 +0200
commit877fd5089abaa58273c6b251f9ca30c4303e3632 (patch)
tree316bdb61aaceee2637847f3cd28361dd5a757498 /src
parent09e5d87069f16e60918d71a8d00b891e2981f166 (diff)
downloadlibplist-877fd5089abaa58273c6b251f9ca30c4303e3632.tar.gz
libplist-877fd5089abaa58273c6b251f9ca30c4303e3632.tar.bz2
Fix leak in dispatch_AFC_packet
Diffstat (limited to 'src')
-rw-r--r--src/AFC.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/AFC.c b/src/AFC.c
index 01e8497..b23ca0f 100644
--- a/src/AFC.c
+++ b/src/AFC.c
@@ -179,7 +179,11 @@ static int dispatch_AFC_packet(AFClient *client, const char *data, int length) {
if (debug) fwrite(buffer, 1, client->afc_packet->this_length, stdout);
if (debug) fprintf(stderr, "\n");
bytes = mux_send(client->connection, buffer, client->afc_packet->this_length);
- if (buffer) free(buffer);
+
+ if (buffer) {
+ free(buffer);
+ buffer = NULL;
+ }
return bytes;
}
return -1;