Bug 1123527 - Fix a trivial leak. r=jhford.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 15 Jan 2015 22:11:41 -0800
changeset 251957 fa7dbc827709ea19e84d714bc783113daec21946
parent 251956 7c1d68ba4efe4ac3766b3e3a6188c7e79fb3db16
child 251958 34fe493c58066b6e0087e0af38713dd1119ca63a
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhford
bugs1123527
milestone38.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 1123527 - Fix a trivial leak. r=jhford. cppcheck found this. Not important, but doesn't hurt to fix it.
b2g/gaia/run-b2g.c
--- a/b2g/gaia/run-b2g.c
+++ b/b2g/gaia/run-b2g.c
@@ -24,16 +24,17 @@ int main(int argc, char* argv[], char* e
     cwd = realpath(dirname(argv[0]), NULL);
     full_path = (char*) malloc(strlen(cwd) + strlen(B2G_NAME) + 2);
     if (!full_path) {
         error(NOMEM);
         return -2;
     }
     full_profile_path = (char*) malloc(strlen(cwd) + strlen(GAIA_PATH) + 2);
     if (!full_profile_path) {
+        free(full_path);
         error(NOMEM);
         return -2;
     }
     sprintf(full_path, "%s/%s", cwd, B2G_NAME);
     sprintf(full_profile_path, "%s/%s", cwd, GAIA_PATH);
     free(cwd);
     printf("Running: %s --profile %s\n", full_path, full_profile_path);
     fflush(stdout);