Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory
netcdf
parseServers-Fix-uninitialized-variable-simplif...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File parseServers-Fix-uninitialized-variable-simplify-error-path.patch of Package netcdf
From: Egbert Eich <eich@suse.com> Date: Sat Jul 10 09:41:22 2021 +0200 Subject: parseServers(): Fix uninitialized variable simplify error path Patch-mainline: Not yet Git-repo: https://github.com/Unidata/netcdf-c Git-commit: 06fbbbc78023abca48ae3a69aa409f7f0a4cf3a3 References: When rtslen == 0 code jumped to 'done' where it checked for rts being != NULL. At this point, rts was not yet set. Fixed code paths eliminating unneeded tests and jumps. Signed-off-by: Egbert Eich <eich@suse.com> Signed-off-by: Egbert Eich <eich@suse.de> --- include/nctestserver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nctestserver.h b/include/nctestserver.h index 978210c8..e7b63b80 100644 --- a/include/nctestserver.h +++ b/include/nctestserver.h @@ -47,7 +47,7 @@ parseServers(const char* remotetestservers) size_t rtslen = strlen(remotetestservers); /* Keep LGTM quiet */ - if(rtslen > MAXREMOTETESTSERVERS) goto done; + if(rtslen > MAXREMOTETESTSERVERS) return NULL; list = (char**)malloc(sizeof(char*) * (int)(rtslen/2)); if(list == NULL) return NULL; rts = strdup(remotetestservers); @@ -65,8 +65,8 @@ parseServers(const char* remotetestservers) *l = NULL; servers = list; list = NULL; + free(rts); done: - if(rts) free(rts); if(list) free(list); return servers; }
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