Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
fonttosfnt.20912
0022-writeFile-avoid-file-leak-on-errors.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0022-writeFile-avoid-file-leak-on-errors.patch of Package fonttosfnt.20912
From 2d30328f9c5390eb38d4052028cd00bafaa151d4 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat, 31 Oct 2020 21:01:02 -0700 Subject: [PATCH] writeFile: avoid file leak on errors Resolves issues found by Oracle Parfait 4.0 static analyser: File Leak [file-ptr-leak]: Leaked File out at line 337 of app/fonttosfnt/write.c in function 'writeFile'. out initialized at line 330 with fopen File Leak [file-ptr-leak]: Leaked File out at line 366 of app/fonttosfnt/write.c in function 'writeFile'. out initialized at line 330 with fopen Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> --- write.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/write.c b/write.c index ca7c95a..e68b70c 100644 --- a/write.c +++ b/write.c @@ -334,7 +334,7 @@ writeFile(char *filename, FontPtr font) current_cmap = makeCmap(font); if(current_cmap == NULL) { fprintf(stderr, "Couldn't build cmap.\n"); - return -1; + goto fail; } fontMetrics(font); @@ -363,7 +363,7 @@ writeFile(char *filename, FontPtr font) strike->indexSubTables = makeIndexSubTables(strike, current_cmap); if(!strike->indexSubTables) { fprintf(stderr, "Couldn't build indexSubTable.\n"); - return -1; + goto fail; } strike = strike->next; } @@ -449,6 +449,7 @@ writeFile(char *filename, FontPtr font) return 0; fail: + fclose(out); unlink(filename); return -1; } -- GitLab
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor