[Asterisk-code-review] app voicemail: always copy dynamic struct to avoid race cond... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Thu Mar 17 15:05:39 CDT 2016


Richard Mudgett has posted comments on this change.

Change subject: app_voicemail: always copy dynamic struct to avoid race condition
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/2433/3//COMMIT_MSG
Commit Message:

Line 18: Tested by: Andrew Nagy
       : Change-Id: I3a0643813116da84e2617291903d0d489b7425fb
NIT: A blank line would be nice here.


https://gerrit.asterisk.org/#/c/2433/3/apps/app_voicemail.c
File apps/app_voicemail.c:

Line 1728: 			vmu->email = ast_strdup(cur->email);
         : 			vmu->emailbody = ast_strdup(cur->emailbody);
         : 			vmu->emailsubject = ast_strdup(cur->emailsubject);
This is going to leak memory on non-allocated vmu's when it replaces the existing strings.  I checked and these strings are always allocated so a simple ast_free(vmu->emailxxx) before replacing is needed.


-- 
To view, visit https://gerrit.asterisk.org/2433
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3a0643813116da84e2617291903d0d489b7425fb
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Andrew Nagy <andrew.nagy at the159.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list