diff options
Diffstat (limited to 'src/activation.c')
-rw-r--r-- | src/activation.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/activation.c b/src/activation.c index 72e6ee7..0a56dc7 100644 --- a/src/activation.c +++ b/src/activation.c @@ -608,8 +608,6 @@ static char* urlencode(const char* buf) static int plist_strip_xml(char** xmlplist) { - uint32_t size = 0; - if (!xmlplist || !*xmlplist) return -1; @@ -622,16 +620,15 @@ static int plist_strip_xml(char** xmlplist) return -1; start += strlen("<plist version=\"1.0\">\n"); - size = stop - start; + uint32_t size = stop - start; char* stripped = malloc(size + 1); if (!stripped) return -1; - memset(stripped, '\0', size + 1); memcpy(stripped, start, size); + stripped[size] = '\0'; free(*xmlplist); *xmlplist = stripped; - stripped = NULL; return 0; } |