summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar BALATON Zoltan2016-07-12 23:34:27 +0200
committerGravatar BALATON Zoltan2017-02-07 18:32:39 +0100
commit1728254f3a51b8b4d7de902dd53f12141085109c (patch)
tree286124ad1c242835c59522aba32141f4340c0988 /src/recovery.c
parent00a9e576ebf0dec261c67644d6c7eba7ea9afd23 (diff)
downloadidevicerestore-1728254f3a51b8b4d7de902dd53f12141085109c.tar.gz
idevicerestore-1728254f3a51b8b4d7de902dd53f12141085109c.tar.bz2
Remove some unneded variables and conditionals and plug some potential memory leaks
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/recovery.c b/src/recovery.c
index 134742e..13612c4 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -168,17 +168,13 @@ int recovery_enter_restore(struct idevicerestore_client_t* client, plist_t build
char* value = NULL;
irecv_getenv(client->recovery->client, "build-version", &value);
info("iBoot build-version=%s\n", (value) ? value : "(unknown)");
- if (value) {
- free(value);
- value = NULL;
- }
+ free(value);
+ value = NULL;
irecv_getenv(client->recovery->client, "build-style", &value);
info("iBoot build-style=%s\n", (value) ? value : "(unknown)");
- if (value) {
- free(value);
- value = NULL;
- }
+ free(value);
+ value = NULL;
unsigned long radio_error = 0;
irecv_getenv(client->recovery->client, "radio-error", &value);
@@ -273,6 +269,7 @@ int recovery_send_component(struct idevicerestore_client_t* client, plist_t buil
if (!path) {
if (build_identity_get_component_path(build_identity, component, &path) < 0) {
error("ERROR: Unable to get path for component '%s'\n", component);
+ free(path);
return -1;
}
}