[asterisk-commits] seanbright: trunk r196270 - /trunk/res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 22 11:51:26 CDT 2009


Author: seanbright
Date: Fri May 22 11:51:22 2009
New Revision: 196270

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196270
Log:
Fix res_agi compilation after the const-ify the world merge.

Since we are dealing with a 'const char * const' now, we have to create a
temporary copy of the string to work on rather than the original.  Fix inspired
by reporter.  Reviewed by everyone-and-their-mother in #asterisk-dev.

(closes issue #15184)
Reported by: andrew

Modified:
    trunk/res/res_agi.c

Modified: trunk/res/res_agi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/res/res_agi.c?view=diff&rev=196270&r1=196269&r2=196270
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Fri May 22 11:51:22 2009
@@ -3199,9 +3199,9 @@
 		fprintf(htmlfile, "<TR><TH ALIGN=\"CENTER\"><B>%s - %s</B></TH></TR>\n", fullcmd, command->summary);
 #ifdef AST_XML_DOCS
 		stringptmp = ast_xmldoc_printable(command->usage, 0);
-		stringp = stringptmp;
+		stringp = ast_strdup(stringptmp);
 #else
-		stringp = command->usage;
+		stringp = ast_strdup(command->usage);
 #endif
 		tempstr = strsep(&stringp, "\n");
 
@@ -3216,6 +3216,7 @@
 		}
 		fprintf(htmlfile, "</TD></TR>\n");
 		fprintf(htmlfile, "</TABLE></TD></TR>\n\n");
+		ast_free(stringp);
 #ifdef AST_XML_DOCS
 		ast_free(stringptmp);
 #endif




More information about the asterisk-commits mailing list