Index: apps/app_curl.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_curl.c,v retrieving revision 1.6 diff -u -r1.6 app_curl.c --- apps/app_curl.c 21 Apr 2005 06:02:43 -0000 1.6 +++ apps/app_curl.c 26 May 2005 10:10:39 -0000 @@ -115,13 +115,15 @@ curl_easy_perform(curl); curl_easy_cleanup(curl); - chunk.memory[chunk.size] = '\0'; - if (chunk.memory[chunk.size - 1] == 10) - chunk.memory[chunk.size - 1] = '\0'; + if (chunk.memory) { + chunk.memory[chunk.size] = '\0'; + if (chunk.memory[chunk.size - 1] == 10) + chunk.memory[chunk.size - 1] = '\0'; - pbx_builtin_setvar_helper(chan, "CURL", chunk.memory); + pbx_builtin_setvar_helper(chan, "CURL", chunk.memory); - free(chunk.memory); + free(chunk.memory); + } } else { ast_log(LOG_ERROR, "Cannot allocate curl structure\n"); res = -1;