Bug 891551 - Part 3: Fix bug where we weren't performing a null check in dtor for NrSocket (see also bug 987380). r=bwc
authorPeter Tatrai <ptatrai@gmail.com>
Fri, 02 May 2014 10:50:00 -0700
changeset 181602 1c40e473da4c6cf3b0231c34375776d76ea393d6
parent 181601 44790b5e19768b0e1f67747a9d38a092e2493b10
child 181603 5964662eaece1c63ed2186e9af9d5eceb25d9a62
push id26724
push userkwierso@gmail.com
push dateTue, 06 May 2014 03:51:22 +0000
treeherdermozilla-central@6d991528460d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs891551, 987380
milestone32.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 891551 - Part 3: Fix bug where we weren't performing a null check in dtor for NrSocket (see also bug 987380). r=bwc
media/mtransport/nr_socket_prsock.h
--- a/media/mtransport/nr_socket_prsock.h
+++ b/media/mtransport/nr_socket_prsock.h
@@ -122,17 +122,18 @@ private:
   uint32_t poll_flags_;
 };
 
 class NrSocket : public NrSocketBase,
                  public nsASocketHandler {
 public:
   NrSocket() : fd_(nullptr) {}
   virtual ~NrSocket() {
-    PR_Close(fd_);
+    if (fd_)
+      PR_Close(fd_);
   }
 
   // Implement nsASocket
   virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags);
   virtual void OnSocketDetached(PRFileDesc *fd);
   virtual void IsLocal(bool *aIsLocal);
   virtual uint64_t ByteCountSent() { return 0; }
   virtual uint64_t ByteCountReceived() { return 0; }