summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorMichiel van Baak <michiel@vanbaak.info>2008-09-14 22:16:34 +0000
committerMichiel van Baak <michiel@vanbaak.info>2008-09-14 22:16:34 +0000
commitc8c11aae993f9a01e671f6cf4105fa5ae01757da (patch)
tree34481c5c36c793fc33af95a65f8e4041b02d525e /channels/chan_skinny.c
parente584eb0661a6ac097d80507a1c54fb12a662e190 (diff)
plug a couple of memleaks in chan_skinny.
(closes issue #13452) Reported by: pj Patches: memleak5.diff uploaded by wedhorn (license 30) Tested by: wedhorn, pj, mvanbaak (closes issue #13294) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@143082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index b25d492b9..6eb2c5902 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1851,7 +1851,7 @@ static int transmit_response(struct skinny_device *d, struct skinny_req *req)
memcpy(s->outbuf+skinny_header_size, &req->data, letohl(req->len));
res = write(s->fd, s->outbuf, letohl(req->len)+8);
-
+
if (res != letohl(req->len)+8) {
ast_log(LOG_WARNING, "Transmit: write only sent %d out of %d bytes: %s\n", res, letohl(req->len)+8, strerror(errno));
if (res == -1) {
@@ -1862,6 +1862,7 @@ static int transmit_response(struct skinny_device *d, struct skinny_req *req)
}
+ ast_free(req);
ast_mutex_unlock(&s->lock);
return 1;
}
@@ -1963,9 +1964,11 @@ static void transmit_tone(struct skinny_device *d, int tone, int instance, int r
req->data.stoptone.reference = htolel(reference);
}
- if (tone > 0) {
- req->data.starttone.tone = htolel(tone);
- }
+ //Bad, tone is already set so this is redundant and a change to the if above
+ //may lead to issues where we try to set a tone to a stop_tone_message
+ //if (tone > 0) {
+ // req->data.starttone.tone = htolel(tone);
+ //}
transmit_response(d, req);
}
@@ -2029,8 +2032,10 @@ static void transmit_displaymessage(struct skinny_device *d, const char *text, i
if (!(req = req_alloc(0, CLEAR_DISPLAY_MESSAGE)))
return;
- req->data.clearpromptstatus.lineInstance = instance;
- req->data.clearpromptstatus.callReference = reference;
+ //what do we want hear CLEAR_DISPLAY_MESSAGE or CLEAR_PROMPT_STATUS???
+ //if we are clearing the display, it appears there is no instance and refernece info (size 0)
+ //req->data.clearpromptstatus.lineInstance = instance;
+ //req->data.clearpromptstatus.callReference = reference;
if (skinnydebug)
ast_verb(1, "Clearing Display\n");
@@ -3549,6 +3554,7 @@ static int skinny_hangup(struct ast_channel *ast)
sub->rtp = NULL;
}
ast_mutex_unlock(&sub->lock);
+ ast_free(sub);
return 0;
}