summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParth Wazurkar <parthwazurkar@gmail.com>2018-08-10 18:11:10 +0530
committerParth Wazurkar <parthwazurkar@gmail.com>2018-08-10 18:11:10 +0530
commitfd2b16f01fa0444eea1e4a13cceae319b6a8d7a3 (patch)
tree0758cb775224f47f4a30b9895c7950f43f68877f
parentb76b34ef5d77b7b67f497d671dd15763bc6ced6f (diff)
downloadfreetype2-fd2b16f01fa0444eea1e4a13cceae319b6a8d7a3.tar.gz
[tfm] Resolve memory leak errors.
* src/tfm/tfmobjs.c(tfm_close): Remove double freeing of `stream' object. * src/gf/gfdrivr.c(TFM_Read_Metrics): Fix oversight errors.
-rw-r--r--src/gf/gfdrivr.c1
-rw-r--r--src/tfm/tfmobjs.c15
2 files changed, 6 insertions, 10 deletions
diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index acd7f40d2..df78f7686 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -523,7 +523,6 @@
*/
face->tfm_data = fi;
- fi = NULL;
}
Exit:
diff --git a/src/tfm/tfmobjs.c b/src/tfm/tfmobjs.c
index 8cd3b5bf5..7e4ec55e9 100644
--- a/src/tfm/tfmobjs.c
+++ b/src/tfm/tfmobjs.c
@@ -131,9 +131,9 @@
FT_LOCAL( void )
tfm_close( TFM_Parser parser )
{
- FT_Memory memory = parser->memory;
+ FT_UNUSED( parser );
- FT_FREE( parser->stream );
+ /* nothing */
}
@@ -346,13 +346,10 @@
fi->slant = (FT_ULong)((double)fi->slant/(double)(1<<20));
Exit:
- if( !ci || !w || !h || !d )
- {
- FT_FREE(ci);
- FT_FREE(w);
- FT_FREE(h);
- FT_FREE(d);
- }
+ FT_FREE(ci);
+ FT_FREE(w);
+ FT_FREE(h);
+ FT_FREE(d);
return error;
}