Bump so revision for 2.3.2

Fix a few minor leaks in error cases.
This commit is contained in:
Keith Packard 2005-04-27 16:22:46 +00:00
parent 1cb309adcb
commit 5c1853cd4c
1 changed files with 10 additions and 1 deletions

View File

@ -141,6 +141,7 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
{ {
fprintf (stderr, "Can't create directory set\n"); fprintf (stderr, "Can't create directory set\n");
ret++; ret++;
FcFontSetDestroy (set);
continue; continue;
} }
@ -162,23 +163,31 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
perror (""); perror ("");
ret++; ret++;
} }
FcFontSetDestroy (set);
FcStrSetDestroy (subdirs);
continue; continue;
} }
if (stat ((char *) dir, &statb) == -1) if (stat ((char *) dir, &statb) == -1)
{ {
fprintf (stderr, "\"%s\": ", dir); fprintf (stderr, "\"%s\": ", dir);
perror (""); perror ("");
FcFontSetDestroy (set);
FcStrSetDestroy (subdirs);
ret++; ret++;
continue; continue;
} }
if (!S_ISDIR (statb.st_mode)) if (!S_ISDIR (statb.st_mode))
{ {
fprintf (stderr, "\"%s\": not a directory, skipping\n", dir); fprintf (stderr, "\"%s\": not a directory, skipping\n", dir);
FcFontSetDestroy (set);
FcStrSetDestroy (subdirs);
continue; continue;
} }
if (!FcDirScan (set, subdirs, 0, FcConfigGetBlanks (config), dir, force)) if (!FcDirScan (set, subdirs, 0, FcConfigGetBlanks (config), dir, force))
{ {
fprintf (stderr, "\"%s\": error scanning\n", dir); fprintf (stderr, "\"%s\": error scanning\n", dir);
FcFontSetDestroy (set);
FcStrSetDestroy (subdirs);
ret++; ret++;
continue; continue;
} }
@ -201,6 +210,7 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
} }
FcFontSetDestroy (set); FcFontSetDestroy (set);
sublist = FcStrListCreate (subdirs); sublist = FcStrListCreate (subdirs);
FcStrSetDestroy (subdirs);
if (!sublist) if (!sublist)
{ {
fprintf (stderr, "Can't create subdir list in \"%s\"\n", dir); fprintf (stderr, "Can't create subdir list in \"%s\"\n", dir);
@ -208,7 +218,6 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
continue; continue;
} }
ret += scanDirs (sublist, config, program, force, verbose); ret += scanDirs (sublist, config, program, force, verbose);
FcStrSetDestroy (subdirs);
} }
FcStrListDone (list); FcStrListDone (list);
return ret; return ret;