diff options
author | 2021-08-04 08:11:17 +0300 | |
---|---|---|
committer | 2022-05-02 12:04:50 +0200 | |
commit | 3c72864eca9e68897b07f1b4dd11b722bd4b82d4 (patch) | |
tree | 46838456fefe5129bf1f9290f4ffa73d3bfdc285 /src/lockdown.c | |
parent | 795af998e26894ede2245f6dd4d1ecd85478f4a2 (diff) | |
download | libimobiledevice-3c72864eca9e68897b07f1b4dd11b722bd4b82d4.tar.gz libimobiledevice-3c72864eca9e68897b07f1b4dd11b722bd4b82d4.tar.bz2 |
lockdownd: Fix memory leaks in error conditions
Diffstat (limited to 'src/lockdown.c')
-rw-r--r-- | src/lockdown.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index d0922dd..505b13e 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
@@ -766,12 +766,15 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new_with_handshake(idevi | |||
766 | uerr = userpref_read_pair_record(client_loc->device->udid, &pair_record); | 766 | uerr = userpref_read_pair_record(client_loc->device->udid, &pair_record); |
767 | if (uerr == USERPREF_E_READ_ERROR) { | 767 | if (uerr == USERPREF_E_READ_ERROR) { |
768 | debug_info("ERROR: Failed to retrieve pair record for %s", client_loc->device->udid); | 768 | debug_info("ERROR: Failed to retrieve pair record for %s", client_loc->device->udid); |
769 | lockdownd_client_free(client_loc); | ||
769 | return LOCKDOWN_E_RECEIVE_TIMEOUT; | 770 | return LOCKDOWN_E_RECEIVE_TIMEOUT; |
770 | } else if (uerr == USERPREF_E_NOENT) { | 771 | } else if (uerr == USERPREF_E_NOENT) { |
771 | debug_info("ERROR: No pair record for %s", client_loc->device->udid); | 772 | debug_info("ERROR: No pair record for %s", client_loc->device->udid); |
773 | lockdownd_client_free(client_loc); | ||
772 | return LOCKDOWN_E_INVALID_CONF; | 774 | return LOCKDOWN_E_INVALID_CONF; |
773 | } else if (uerr != USERPREF_E_SUCCESS) { | 775 | } else if (uerr != USERPREF_E_SUCCESS) { |
774 | debug_info("ERROR: Failed to retrieve or parse pair record for %s", client_loc->device->udid); | 776 | debug_info("ERROR: Failed to retrieve or parse pair record for %s", client_loc->device->udid); |
777 | lockdownd_client_free(client_loc); | ||
775 | return LOCKDOWN_E_INVALID_CONF; | 778 | return LOCKDOWN_E_INVALID_CONF; |
776 | } | 779 | } |
777 | if (pair_record) { | 780 | if (pair_record) { |