func_curl: Fix leak of an ast_str in error handling code path.
authorRussell Bryant <russell@russellbryant.com>
Sat, 24 Mar 2012 23:49:39 +0000 (23:49 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 24 Mar 2012 23:49:39 +0000 (23:49 +0000)
........

Merged revisions 360413 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 360414 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360415 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_curl.c

index 8f49c16..e011461 100644 (file)
@@ -608,6 +608,7 @@ static int acf_curl_helper(struct ast_channel *chan, const char *cmd, char *info
 
        if (!(curl = ast_threadstorage_get(&curl_instance, sizeof(*curl)))) {
                ast_log(LOG_ERROR, "Cannot allocate curl structure\n");
+               ast_free(str);
                return -1;
        }