Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fontconfig
fontconfig
Commits
6f9fcb51
Commit
6f9fcb51
authored
Jan 25, 2006
by
Patrick Lam
Browse files
Fix memory leaks reported by Ronny V. Vindenes.
parent
986e3597
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
6f9fcb51
2006-01-24 Patrick Lam <plam@mit.edu>
* src/fccache.c (FcDirCacheUnlink, FcDirCacheWrite):
* src/fcfreetype.c (FcFreeTypeQuery):
Fix memory leaks reported by Ronny V. Vindenes.
2006-01-19 Andreas Schwab <schwab@suse.de>
reviewed by: plam
...
...
src/fccache.c
View file @
6f9fcb51
...
...
@@ -658,7 +658,7 @@ FcBool
FcDirCacheUnlink
(
const
FcChar8
*
dir
,
FcConfig
*
config
)
{
char
*
cache_file
;
char
*
cache_hashed
;
char
*
cache_hashed
=
0
;
int
fd
,
collisions
;
struct
stat
cache_stat
;
char
name_buf
[
FC_MAX_FILE_LEN
];
...
...
@@ -677,6 +677,9 @@ FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config)
fd
=
-
1
;
collisions
=
0
;
do
{
if
(
cache_hashed
)
FcStrFree
((
FcChar8
*
)
cache_hashed
);
cache_hashed
=
FcDirCacheHashName
(
cache_file
,
collisions
++
);
if
(
!
cache_hashed
)
goto
bail
;
...
...
@@ -692,7 +695,10 @@ FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config)
FcCacheReadString
(
fd
,
name_buf
,
sizeof
(
name_buf
));
if
(
!
strlen
(
name_buf
))
{
FcStrFree
((
FcChar8
*
)
cache_hashed
);
goto
bail
;
}
}
while
(
strcmp
(
name_buf
,
cache_file
)
!=
0
);
FcStrFree
((
FcChar8
*
)
cache_file
);
...
...
@@ -1189,6 +1195,7 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
if
(
ftruncate
(
fd
,
current_arch_start
+
truncate_to
)
==
-
1
)
goto
bail5
;
free
(
header
);
close
(
fd
);
if
(
!
FcAtomicReplaceOrig
(
atomic
))
goto
bail5
;
...
...
src/fcfreetype.c
View file @
6f9fcb51
...
...
@@ -1000,6 +1000,7 @@ FcFreeTypeQuery (const FcChar8 *file,
FcChar8 *family = 0;
#endif
FcChar8
*
complex
;
FcChar8
*
file2
;
const
FcChar8
*
foundry
=
0
;
int
spacing
;
TT_OS2
*
os2
;
...
...
@@ -1280,8 +1281,13 @@ FcFreeTypeQuery (const FcChar8 *file,
printf
(
"Saving unique fullname %s
\n
"
,
full
);
}
if
(
!
FcPatternAddString
(
pat
,
FC_FILE
,
(
FcChar8
*
)
basename
((
char
*
)
FcStrCopy
(
file
))))
file2
=
FcStrCopy
(
file
);
if
(
!
FcPatternAddString
(
pat
,
FC_FILE
,
(
FcChar8
*
)
basename
((
char
*
)
file2
)))
{
FcStrFree
(
file2
);
goto
bail1
;
}
FcStrFree
(
file2
);
FcPatternAddFullFname
(
pat
,
(
const
char
*
)
FcStrCopy
(
file
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment