Clean up temporary directory for tests

This commit is contained in:
Akira TAGOH 2019-07-23 04:18:59 +00:00
parent 36f46ba720
commit e261e31731
1 changed files with 6 additions and 3 deletions

View File

@ -179,8 +179,8 @@ int
main(void)
{
FcConfig *cfg = FcConfigCreate ();
char *basedir, template[512] = "/tmp/fc107-XXXXXX";
char *sysroot, systempl[512] = "/tmp/fc107-XXXXXX";
char *basedir = NULL, template[512] = "/tmp/fc107-XXXXXX";
char *sysroot = NULL, systempl[512] = "/tmp/fc107-XXXXXX";
FcChar8 *d = NULL, *dd = NULL;
FcCache *c = NULL;
const FcChar8 *doc = ""
@ -257,7 +257,10 @@ main(void)
retval = 0;
bail:
fprintf (stderr, "Cleaning up\n");
unlink_dirs (basedir);
if (basedir)
unlink_dirs (basedir);
if (sysroot)
unlink_dirs (sysroot);
if (dd)
free (dd);
FcConfigDestroy (cfg);