summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-06-04 14:06:26 +0200
committerGravatar Nikias Bassen2010-06-04 14:06:26 +0200
commit2169750afea6e8a50da249a1def1112b95d3003e (patch)
tree311ff25681ac3151d4624fc09f5f4873497b9851
parent837d5b0f5a401389802bddb468372a9bcbd418a0 (diff)
downloadlibimobiledevice-2169750afea6e8a50da249a1def1112b95d3003e.tar.gz
libimobiledevice-2169750afea6e8a50da249a1def1112b95d3003e.tar.bz2
lockdown: correctly handle activation_record parameter in lockdownd_activate
The activation_record was inserted into the request plist and freed at the end. If the user app then uses plist_free to free the activation record, it gets an invalid free. By using plist_copy the activation_record is not touched.
-rw-r--r--src/lockdown.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index ab49a6a..edd47e5 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -1442,7 +1442,7 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
plist_dict_insert_item(dict,"Request", plist_new_string("Activate"));
- plist_dict_insert_item(dict,"ActivationRecord", activation_record);
+ plist_dict_insert_item(dict,"ActivationRecord", plist_copy(activation_record));
ret = lockdownd_send(client, dict);
plist_free(dict);