Skip to content

Commit

Permalink
[cwave:r70] fix memory leak - unfreed pkt
Browse files Browse the repository at this point in the history
  • Loading branch information
smokku committed Dec 15, 2009
1 parent 1938209 commit fa25fbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions sm/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ void dispatch(sm_t sm, pkt_t pkt) {

case mod_PASS:
/* ignore IQ result packets that haven't been handled - XMPP 9.2.3.4 */
if(pkt->type == pkt_IQ_RESULT)
if(pkt->type == pkt_IQ_RESULT) {
pkt_free(pkt);
break;
else
} else
ret = -stanza_err_FEATURE_NOT_IMPLEMENTED;

default:
pkt_router(pkt_error(pkt, -ret));

break;
}

Expand All @@ -143,7 +144,7 @@ void dispatch(sm_t sm, pkt_t pkt) {
pkt_router(pkt_error(pkt, stanza_err_SERVICE_UNAVAILABLE));
return;
}

if (pkt != NULL && pkt->sm != NULL) {
ret = mm_pkt_user(pkt->sm->mm, user, pkt);
switch(ret) {
Expand All @@ -152,9 +153,10 @@ void dispatch(sm_t sm, pkt_t pkt) {

case mod_PASS:
/* ignore IQ result packets that haven't been handled - XMPP 9.2.3.4 */
if(pkt->type == pkt_IQ_RESULT)
if(pkt->type == pkt_IQ_RESULT) {
pkt_free(pkt);
break;
else
} else
ret = -stanza_err_FEATURE_NOT_IMPLEMENTED;

default:
Expand Down
2 changes: 1 addition & 1 deletion sm/mod_vacation.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static mod_ret_t _vacation_in_sess(mod_instance_t mi, sess_t sess, pkt_t pkt) {

pkt_tofrom(pkt);
nad_set_attr(pkt->nad, 1, -1, "type", "result", 6);

pkt_sess(pkt, sess);

return mod_HANDLED;
Expand Down

0 comments on commit fa25fbc

Please sign in to comment.