Revision
14112
Author
rupa
Date
2009-07-02 10:23:54 -0500 (Thu, 02 Jul 2009)

Log Message

fix usage
fix null free crash when called w/out arguments

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c (14111 => 14112)


--- freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c	2009-07-02 15:12:01 UTC (rev 14111)
+++ freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c	2009-07-02 15:23:54 UTC (rev 14112)
@@ -43,7 +43,7 @@
  */
 SWITCH_MODULE_DEFINITION(mod_curl, mod_curl_load, mod_curl_shutdown, NULL);
 
-static char *SYNTAX = "curl url [headers]";
+static char *SYNTAX = "curl url [headers|json]";
 
 static struct {
 	switch_memory_pool_t *pool;
@@ -287,7 +287,9 @@
 	
 done:
 	switch_safe_free(stream.data);
-	curl_slist_free_all(http_data->headers);
+	if (http_data && http_data->headers) {
+		curl_slist_free_all(http_data->headers);
+	}
 	if (!session) {
 		switch_core_destroy_memory_pool(&pool);
 	}
@@ -356,7 +358,9 @@
 	switch_goto_status(status, done);
 	
 done: 
-	curl_slist_free_all(http_data->headers);
+	if (http_data && http_data->headers) {
+		curl_slist_free_all(http_data->headers);
+	}
 	switch_safe_free(mydata);
 	if (!session) {
 		switch_core_destroy_memory_pool(&pool);