Bug 836829 - Fix missing result check in Mac exception handler. r=ted
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Mon, 22 Apr 2013 13:29:12 +0200
changeset 129471 e2f4b1c75ff6da7d390a278418177c692e2c68f9
parent 129470 ebb2d369bad2044b742fc54251fb985efbbc5e46
child 129472 ab61f99fb584d059d5133edf639662dc80b40ce0
push idunknown
push userunknown
push dateunknown
reviewersted
bugs836829
milestone23.0a1
Bug 836829 - Fix missing result check in Mac exception handler. r=ted
toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
@@ -276,19 +276,23 @@ bool ExceptionHandler::WriteMinidump(boo
 
   use_minidump_write_mutex_ = true;
   last_minidump_write_result_ = false;
 
   // Lock the mutex.  Since we just created it, this will return immediately.
   if (pthread_mutex_lock(&minidump_write_mutex_) == 0) {
     // Send an empty message to the handle port so that a minidump will
     // be written
-    SendMessageToHandlerThread(write_exception_stream ?
-                                   kWriteDumpWithExceptionMessage :
-                                   kWriteDumpMessage);
+    bool result = SendMessageToHandlerThread(write_exception_stream ?
+                                             kWriteDumpWithExceptionMessage :
+                                             kWriteDumpMessage);
+    if (!result) {
+      pthread_mutex_unlock(&minidump_write_mutex_);
+      return false;
+    }
 
     // Wait for the minidump writer to complete its writing.  It will unlock
     // the mutex when completed
     pthread_mutex_lock(&minidump_write_mutex_);
   }
 
   use_minidump_write_mutex_ = false;
   UpdateNextID();