aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/ns.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-05-07 23:02:14 -0300
committerdequis <dx@dxzone.com.ar>2015-05-07 23:02:14 -0300
commit088b07018963158ca822a289f4db7085454f9713 (patch)
tree28179cd79c37e1ca85c40c31a0a8ec3ae6652438 /protocols/msn/ns.c
parent5535a47f4c2b9def68356d1ced9a149a7197f32c (diff)
msn: fix use-after-free when the server sends OUT
Also fix a leak in msn_ns_callback while i'm at it. Also fix a potential null deref when req->reply_body is null and BITLBEE_DEBUG is enabled, but i don't even know if this one can happen.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r--protocols/msn/ns.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index 0011d7e7..0aab149d 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -180,6 +180,7 @@ static gboolean msn_ns_callback(gpointer data, gint source, b_input_condition co
if (st <= 0) {
imcb_error(ic, "Error while reading from server");
imc_logout(ic, TRUE);
+ g_free(bytes);
return FALSE;
}
@@ -187,11 +188,7 @@ static gboolean msn_ns_callback(gpointer data, gint source, b_input_condition co
g_free(bytes);
- /* Ignore ret == 0, it's already disconnected then. */
- msn_handler(md);
-
- return TRUE;
-
+ return msn_handler(md);
}
int msn_ns_command(struct msn_data *md, char **cmd, int num_parts)