From 78b93edb702a926bc1d618bf69f49322f4a78de3 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Thu, 6 Mar 2014 14:43:15 -0800 Subject: [PATCH] Bug 980270 - Part 1: Plug a couple of common leaks in nICEr. r=drno --- media/mtransport/third_party/nICEr/src/ice/ice_component.c | 1 + media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_component.c b/media/mtransport/third_party/nICEr/src/ice/ice_component.c index 5a50f63616d..4a85900994a 100644 --- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c +++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c @@ -96,6 +96,7 @@ static int nr_ice_pre_answer_request_destroy(nr_ice_pre_answer_request **parp) nr_stun_message_destroy(&par->req.response); RFREE(par->username); + RFREE(par); return(0); } diff --git a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c index 09453782212..9a90e2fdef8 100644 --- a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c +++ b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c @@ -521,6 +521,10 @@ int nr_stun_client_process_response(nr_stun_client_ctx *ctx, UCHAR *msg, int len password = &hmac_key; } + if (ctx->response) { + nr_stun_message_destroy(&ctx->response); + } + if ((r=nr_stun_message_create2(&ctx->response, msg, len))) ABORT(r);