From: Russell Bryant Date: Sat, 20 Mar 2010 16:50:38 +0000 (+0000) Subject: Fix memory corruption found by unit tests. X-Git-Tag: 11.0.0-beta1~3255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=008930a3f20e68083837aef16e72551b71dbd221;p=thirdparty%2Fasterisk.git Fix memory corruption found by unit tests. ast_str_reset() was being called on a potentially uninitialized pointer. Valgrind is my hero, once again. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253579 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index fa0174c60d..184300d25e 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -525,7 +525,7 @@ static int listfilter(struct ast_channel *chan, const char *cmd, char *parse, ch flen = strlen(args.fieldvalue); - ast_str_reset(result); + ast_str_reset(*result_ptr); /* Enough space for any result */ if (len > -1) { ast_str_make_space(result_ptr, len ? len : ast_str_strlen(orig_list) + 1);