diff options
author | Nikias Bassen | 2014-08-06 03:17:28 +0200 |
---|---|---|
committer | Nikias Bassen | 2014-08-06 03:17:28 +0200 |
commit | d9176411fc566299a50d365c74b2d077c3dbd293 (patch) | |
tree | bb40f552dad9b7e6d38f17a901febe94993ce399 /src | |
parent | 2344ec753ea58f93f1a8b889cc564d72bf084964 (diff) | |
download | libimobiledevice-d9176411fc566299a50d365c74b2d077c3dbd293.tar.gz libimobiledevice-d9176411fc566299a50d365c74b2d077c3dbd293.tar.bz2 |
lockdown: Silence compiler warning about ignored return value from asprintf()
Diffstat (limited to 'src')
-rw-r--r-- | src/lockdown.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 6465281..3e2fe06 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -1347,14 +1347,16 @@ lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, cha } while((value = plist_array_get_item(dict, *count)) != NULL) { - plist_get_string_val(value, &val); - newlist = realloc(*classes, sizeof(char*) * (*count+1)); - str_remove_spaces(val); - asprintf(&newlist[*count], "com.apple.%s", val); - free(val); - val = NULL; - *classes = newlist; - *count = *count+1; + plist_get_string_val(value, &val); + newlist = realloc(*classes, sizeof(char*) * (*count+1)); + str_remove_spaces(val); + if (asprintf(&newlist[*count], "com.apple.%s", val) < 0) { + debug_info("ERROR: asprintf failed"); + } + free(val); + val = NULL; + *classes = newlist; + *count = *count+1; } newlist = realloc(*classes, sizeof(char*) * (*count+1)); |