Memory leak in error cases. CID 808.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25644 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-24 16:17:56 +00:00
parent cefcb7b41c
commit a1e3759f69
1 changed files with 4 additions and 1 deletions

View File

@ -1012,12 +1012,15 @@ create_team_arg(struct team_arg **_teamArg, int32 argCount, char * const *args,
// copy the args over
status = copy_strings_array(args, argCount, &argsCopy, kernel);
if (status != B_OK)
if (status != B_OK) {
free(teamArg);
return status;
}
status = copy_strings_array(env, envCount, &envCopy, kernel);
if (status != B_OK) {
free_strings_array(argsCopy, argCount);
free(teamArg);
return status;
}