[asterisk-commits] res smdi: Clean up memory leak (asterisk[15])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 24 12:31:37 CDT 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6291 )
Change subject: res_smdi: Clean up memory leak
......................................................................
res_smdi: Clean up memory leak
Change-Id: I1e33290929e1aa7c5b9cb513f8254f2884974de8
---
M res/res_smdi.c
1 file changed, 4 insertions(+), 6 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, approved
Joshua Colp: Approved for Submit
diff --git a/res/res_smdi.c b/res/res_smdi.c
index e2e5b17..7f9af5c 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -608,12 +608,11 @@
ast_debug(1, "Read a 'D' ... it's an MD message.\n");
- if (!(md_msg = ast_calloc(1, sizeof(*md_msg)))) {
+ md_msg = ao2_alloc(sizeof(*md_msg), NULL);
+ if (!md_msg) {
ao2_ref(iface, -1);
return NULL;
}
-
- md_msg = ao2_alloc(sizeof(*md_msg), NULL);
/* read the message desk number */
for (i = 0; i < sizeof(md_msg->mesg_desk_num) - 1; i++) {
@@ -710,12 +709,11 @@
ast_debug(1, "Read a 'W', it's an MWI message. (No more debug coming for MWI messages)\n");
- if (!(mwi_msg = ast_calloc(1, sizeof(*mwi_msg)))) {
+ mwi_msg = ao2_alloc(sizeof(*mwi_msg), NULL);
+ if (!mwi_msg) {
ao2_ref(iface, -1);
return NULL;
}
-
- mwi_msg = ao2_alloc(sizeof(*mwi_msg), NULL);
/* discard the 'I' (from 'MWI') */
fgetc(iface->file);
--
To view, visit https://gerrit.asterisk.org/6291
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I1e33290929e1aa7c5b9cb513f8254f2884974de8
Gerrit-Change-Number: 6291
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170824/8ea22256/attachment.html>
More information about the asterisk-commits
mailing list