diff options
author | Matt Colyer | 2008-08-07 00:00:12 -0700 |
---|---|---|
committer | Matt Colyer | 2008-08-07 00:00:12 -0700 |
commit | 4c3f86499f8dfe344fb5f92b805e8c090290a79e (patch) | |
tree | bba8b935df1b5ef637065e789a66f7b9fd2888f4 /src/AFC.c | |
parent | 1c6aa3dd8aa8cd985a63ccbfa3848ebbe52715e1 (diff) | |
download | libplist-4c3f86499f8dfe344fb5f92b805e8c090290a79e.tar.gz libplist-4c3f86499f8dfe344fb5f92b805e8c090290a79e.tar.bz2 |
Added cleanup when closing a file, probably needs a bit more throughness
but its a start.
Added a missing unlock call so you can read a file more than once.
Diffstat (limited to 'src/AFC.c')
-rw-r--r-- | src/AFC.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -423,9 +423,11 @@ int afc_read_file(AFClient *client, AFCFile *file, char *data, int length) { bytes = receive_AFC_data(client, &input); if (bytes < 0) { if (input) free(input); + afc_unlock(client); return -1; } else if (bytes == 0) { if (input) free(input); + afc_unlock(client); return current_count; } else { if (input) { @@ -493,6 +495,4 @@ void afc_close_file(AFClient *client, AFCFile *file) { bytes = receive_AFC_data(client, &buffer); afc_unlock(client); return; - if (buffer) free(buffer); // we're *SUPPOSED* to get an "error" here. } - |