Bug 1152137 - Part 2: Remove attributes that could not be initted properly instead of just freeing them. r=ekr
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 08 Apr 2015 16:18:39 -0700
changeset 240252 e2009551c1be2a121ad6baf1241973c3a15c5461
parent 240251 a537946a42621a59b0b3a24f699a014bf28d686a
child 240253 19a79b7400fe0958f62eb6654867f0a4829a7cf1
push id28627
push userkwierso@gmail.com
push dateTue, 21 Apr 2015 22:25:44 +0000
treeherdermozilla-central@fcbc5a4f5bb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersekr
bugs1152137
milestone40.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 1152137 - Part 2: Remove attributes that could not be initted properly instead of just freeing them. r=ekr
media/mtransport/third_party/nICEr/src/stun/stun_msg.c
--- a/media/mtransport/third_party/nICEr/src/stun/stun_msg.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_msg.c
@@ -181,17 +181,19 @@ nr_stun_message_has_attribute(nr_stun_me
     int r,_status; \
     nr_stun_message_attribute *attr = 0; \
     if ((r=nr_stun_message_attribute_create(msg, &attr))) \
         ABORT(r); \
     attr->type = (__type); \
     { __code } \
     _status=0; \
   abort: \
-    if (_status) RFREE(attr); \
+    if (_status){ \
+      nr_stun_message_attribute_destroy(msg, &attr); \
+    } \
     return(_status); \
   }
 
 
 int
 nr_stun_message_add_alternate_server_attribute(nr_stun_message *msg, nr_transport_addr *alternate_server)
 NR_STUN_MESSAGE_ADD_ATTRIBUTE(
     NR_STUN_ATTR_ALTERNATE_SERVER,