func_cdr: Fix CDR_PROP payload leak
authorCorey Farrell <git@cfware.com>
Tue, 28 Oct 2014 11:12:03 +0000 (11:12 +0000)
committerCorey Farrell <git@cfware.com>
Tue, 28 Oct 2014 11:12:03 +0000 (11:12 +0000)
Remove duplicate allocation of payload, preventing leak.

ASTERISK-24455 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4113/
........

Merged revisions 426252 from http://svn.asterisk.org/svn/asterisk/branches/13

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

funcs/func_cdr.c

index c9fce23..2d120bb 100644 (file)
@@ -540,8 +540,7 @@ static int cdr_prop_write(struct ast_channel *chan, const char *cmd, char *parse
                     const char *value)
 {
        RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
-       RAII_VAR(struct cdr_func_payload *, payload,
-               ao2_alloc(sizeof(*payload), NULL), ao2_cleanup);
+       RAII_VAR(struct cdr_func_payload *, payload, NULL, ao2_cleanup);
        RAII_VAR(struct stasis_message_router *, router, ast_cdr_message_router(), ao2_cleanup);
 
        if (!chan) {