Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
zziplib
bsc1084515-ensure-disk_close-to-avoid-mem-leak....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc1084515-ensure-disk_close-to-avoid-mem-leak.patch of Package zziplib
Index: zziplib-0.13.67/bins/unzzipcat-mem.c =================================================================== --- zziplib-0.13.67.orig/bins/unzzipcat-mem.c +++ zziplib-0.13.67/bins/unzzipcat-mem.c @@ -136,6 +136,7 @@ static FILE* create_fopen(char* name, ch static int unzzip_cat (int argc, char ** argv, int extract) { int argn; + int done = 0; ZZIP_MEM_DISK* disk; if (argc == 1) @@ -162,38 +163,38 @@ static int unzzip_cat (int argc, char ** unzzip_mem_disk_cat_file (disk, name, out); if (extract) fclose(out); } - return 0; } - - if (argc == 3 && !extract) + else if (argc == 3 && !extract) { /* list from one spec */ ZZIP_MEM_ENTRY* entry = 0; while ((entry = zzip_mem_disk_findmatch(disk, argv[2], entry, 0, 0))) { unzzip_mem_entry_fprint (disk, entry, stdout); } - - return 0; } - - for (argn=1; argn < argc; argn++) - { /* list only the matching entries - each in order of commandline */ - ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); - for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) - { - char* name = zzip_mem_entry_to_name (entry); - if (! _zzip_fnmatch (argv[argn], name, - FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + else + { + for (argn=1; argn < argc; argn++) + { /* list only the matching entries - each in order of commandline */ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) { - FILE* out = stdout; - if (extract) out = create_fopen(name, "w", 1); - unzzip_mem_disk_cat_file (disk, name, out); - if (extract) fclose(out); - break; /* match loop */ + char* name = zzip_mem_entry_to_name (entry); + if (! _zzip_fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + { + FILE* out = stdout; + if (extract) out = create_fopen(name, "w", 1); + unzzip_mem_disk_cat_file (disk, name, out); + if (extract) fclose(out); + break; /* match loop */ + } } } } - return 0; + zzip_mem_disk_close(disk); + + return done; } int unzzip_print (int argc, char ** argv)
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