lib/repo: Move alloca() outside of loop

Just noticed this while looking at the code for a different issue.

Closes: #1201
Approved by: jlebon
This commit is contained in:
Colin Walters 2017-09-21 11:00:09 -04:00 committed by Atomic Bot
parent 75150fe04a
commit 3767ac4ad8
1 changed files with 1 additions and 1 deletions

View File

@ -5179,11 +5179,11 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
ret_tmpdir.initialized = TRUE;
}
const char *tmpdir_name_template = glnx_strjoina (tmpdir_prefix, "XXXXXX");
while (!ret_tmpdir.initialized)
{
g_auto(GLnxTmpDir) new_tmpdir = { 0, };
/* No existing tmpdir found, create a new */
const char *tmpdir_name_template = glnx_strjoina (tmpdir_prefix, "XXXXXX");
if (!glnx_mkdtempat (tmpdir_dfd, tmpdir_name_template, 0755,
&new_tmpdir, error))
return FALSE;