Bug 980270 - Part 1: Plug a couple of common leaks in nICEr. r=drno, a=sledru
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 06 Mar 2014 14:43:15 -0800
changeset 208171 d8e7408cb510
parent 208170 4767a3451d00
child 208172 dd517186b945
push id3753
push userryanvm@gmail.com
push date2014-07-28 14:29 +0000
treeherdermozilla-beta@ecfc5bee1685 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, sledru
bugs980270
milestone32.0
Bug 980270 - Part 1: Plug a couple of common leaks in nICEr. r=drno, a=sledru
media/mtransport/third_party/nICEr/src/ice/ice_component.c
media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
@@ -91,16 +91,17 @@ static int nr_ice_pre_answer_request_des
 
     par = *parp;
     *parp = 0;
 
     nr_stun_message_destroy(&par->req.request);
     nr_stun_message_destroy(&par->req.response);
 
     RFREE(par->username);
+    RFREE(par);
 
     return(0);
   }
 
 int nr_ice_component_create(nr_ice_media_stream *stream, int component_id, nr_ice_component **componentp)
   {
     int _status;
     nr_ice_component *comp=0;
--- a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
@@ -516,16 +516,20 @@ int nr_stun_client_process_response(nr_s
       else {
         if (r=nr_stun_compute_lt_message_integrity_password(username, ctx->realm,
                                                             password, &hmac_key))
           ABORT(r);
       }
       password = &hmac_key;
     }
 
+    if (ctx->response) {
+      nr_stun_message_destroy(&ctx->response);
+    }
+
     if ((r=nr_stun_message_create2(&ctx->response, msg, len)))
         ABORT(r);
 
     if ((r=nr_stun_decode_message(ctx->response, nr_stun_client_get_password, password))) {
         r_log(NR_LOG_STUN,LOG_WARNING,"STUN-CLIENT(%s): error decoding response",ctx->label);
         ABORT(r);
     }