1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

dtcreate: Fix double free inside ProcessExecString()

This commit is contained in:
William Schaub 2012-08-11 14:46:35 -04:00 committed by Jon Trulson
parent 562da5af1b
commit b17e52a269

View file

@ -851,7 +851,7 @@ int done=FALSE, argfound=FALSE,promptfound=FALSE;
covers the complete string
between %'s
*/
if(argbuf) free(argbuf);
if(argbuf) { free(argbuf); argbuf = NULL; }
if(s2)
{
argbuf = (char *)calloc(1,(s2-s1)+2);
@ -877,7 +877,7 @@ int done=FALSE, argfound=FALSE,promptfound=FALSE;
else if (s1 && *s1)
{
strcat(exec_args[0],s1);
if(argbuf) free(argbuf);
if(argbuf) { free(argbuf); argbuf = NULL; }
done = TRUE;
continue;
}
@ -934,7 +934,7 @@ int done=FALSE, argfound=FALSE,promptfound=FALSE;
argfound = FALSE;
s1=s2;
}
if(argbuf) free(argbuf);
if(argbuf) { free(argbuf); argbuf = NULL; }
return exec_args;
}