Bug 980270 - Part 1: Plug a couple of common leaks in nICEr. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 06 Mar 2014 14:43:15 -0800
changeset 216079 54ee8a6f85a40aebbffcb498004a8df592a82415
parent 216078 1aaa6b1528ff6adb3346c1fa437333f01d3c8ab7
child 216080 3be3729d084edb29fe3bb9d712553f1e826044d2
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs980270
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 980270 - Part 1: Plug a couple of common leaks in nICEr. r=drno
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);
     }