diff options
| author | 2013-11-17 02:40:48 +0100 | |
|---|---|---|
| committer | 2013-11-30 20:13:59 +0100 | |
| commit | 868e336f8337e14e0288ac1d3c9fd89bee6d1961 (patch) | |
| tree | d4ca282bc122791f61709afbd2445870426c4045 /src/idevice.c | |
| parent | 5d429dddc5ed442ae4699ab34c21b35bacef456b (diff) | |
| download | libimobiledevice-868e336f8337e14e0288ac1d3c9fd89bee6d1961.tar.gz libimobiledevice-868e336f8337e14e0288ac1d3c9fd89bee6d1961.tar.bz2 | |
Fix possible memory corruption by ensuring client pointers NULL'd after free
Diffstat (limited to 'src/idevice.c')
| -rw-r--r-- | src/idevice.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c index 3ed2e9f..428f359 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -267,6 +267,7 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection) | |||
| 267 | idevice_error_t result = IDEVICE_E_UNKNOWN_ERROR; | 267 | idevice_error_t result = IDEVICE_E_UNKNOWN_ERROR; |
| 268 | if (connection->type == CONNECTION_USBMUXD) { | 268 | if (connection->type == CONNECTION_USBMUXD) { |
| 269 | usbmuxd_disconnect((int)(long)connection->data); | 269 | usbmuxd_disconnect((int)(long)connection->data); |
| 270 | connection->data = NULL; | ||
| 270 | result = IDEVICE_E_SUCCESS; | 271 | result = IDEVICE_E_SUCCESS; |
| 271 | } else { | 272 | } else { |
| 272 | debug_info("Unknown connection type %d", connection->type); | 273 | debug_info("Unknown connection type %d", connection->type); |
| @@ -276,6 +277,7 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection) | |||
| 276 | free(connection->udid); | 277 | free(connection->udid); |
| 277 | 278 | ||
| 278 | free(connection); | 279 | free(connection); |
| 280 | connection = NULL; | ||
| 279 | 281 | ||
| 280 | return result; | 282 | return result; |
| 281 | } | 283 | } |
