Bug 1366882 - Fix a resource leak - CID 221217 - r=ted
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 22 May 2017 23:23:08 +0200
changeset 410963 4b380c4484bac968a96cf76878de0e0100d23a73
parent 410962 2ec004b70daae60449d9fb91280d170bd0178196
child 410964 90d3eb2f3d002f003f5f044253a237dec54f2689
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1366882, 221217
milestone55.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 1366882 - Fix a resource leak - CID 221217 - r=ted MozReview-Commit-ID: G3THkXZN9GA
toolkit/crashreporter/client/crashreporter_gtk_common.cpp
--- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
+++ b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
@@ -71,18 +71,20 @@ static bool RestartApplication()
 
   unsigned int i;
   for (i = 0; i < gRestartArgs.size(); i++) {
     argv[i] = (char*)gRestartArgs[i].c_str();
   }
   argv[i] = 0;
 
   pid_t pid = fork();
-  if (pid == -1)
+  if (pid == -1) {
+    free(argv);
     return false;
+  }
   else if (pid == 0) {
     (void)execv(argv[0], argv);
     _exit(1);
   }
 
   free(argv);
 
   return true;