Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error: RESOURCE_LEAK (CWE-772): [#def1] [important] chkconfig-1.26/ntsysv.c:316:5: alloc_fn: Storage is returned from allocation function "malloc". chkconfig-1.26/ntsysv.c:316:5: var_assign: Assigning: "services" = storage returned from "malloc(88UL * numServicesAlloced)". chkconfig-1.26/ntsysv.c:321:9: leaked_storage: Variable "services" going out of scope leaks the storage it points to. 319| fprintf(stderr, "failed to open " RUNLEVELS "/init.d: %s\n", 320| strerror(errno)); 321|-> return 2; 322| } 323| Error: RESOURCE_LEAK (CWE-772): [#def2] [important] chkconfig-1.26/ntsysv.c:316:5: alloc_fn: Storage is returned from allocation function "malloc". chkconfig-1.26/ntsysv.c:316:5: var_assign: Assigning: "services" = storage returned from "malloc(88UL * numServicesAlloced)". chkconfig-1.26/ntsysv.c:346:9: noescape: Resource "services + numServices" is not freed or pointed-to in "readServiceInfo". chkconfig-1.26/ntsysv.c:375:13: leaked_storage: Variable "services" going out of scope leaks the storage it points to. 373| fprintf(stderr, "failed to open " XINETDDIR ": %s\n", 374| strerror(errno)); 375|-> return 2; 376| } 377| Error: RESOURCE_LEAK (CWE-772): [#def3] [important] chkconfig-1.26/ntsysv.c:393:17: alloc_fn: Storage is returned from allocation function "realloc". chkconfig-1.26/ntsysv.c:393:17: var_assign: Assigning: "services" = storage returned from "realloc(services, numServicesAlloced * 88UL)". chkconfig-1.26/ntsysv.c:397:13: noescape: Resource "services + numServices" is not freed or pointed-to in "readXinetdServiceInfo". chkconfig-1.26/ntsysv.c:403:17: leaked_storage: Variable "services" going out of scope leaks the storage it points to. 401| ent->d_name, strerror(errno)); 402| closedir(dir); 403|-> return 2; 404| } else if (!rc) 405| numServices++; Error: RESOURCE_LEAK (CWE-772): [#def4] [important] chkconfig-1.26/ntsysv.c:372:9: alloc_fn: Storage is returned from allocation function "opendir". chkconfig-1.26/ntsysv.c:372:9: var_assign: Assigning: "dir" = storage returned from "opendir("/etc/xinetd.d")". chkconfig-1.26/ntsysv.c:378:9: noescape: Resource "dir" is not freed or pointed-to in "readdir". chkconfig-1.26/ntsysv.c:422:5: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. 420| *numServicesPtr = numServices; 421| 422|-> return 0; 423| } 424| Error: CPPCHECK_WARNING (CWE-401): [#def5] [important] chkconfig-1.26/ntsysv.c:321: error[memleak]: Memory leak: services 319| fprintf(stderr, "failed to open " RUNLEVELS "/init.d: %s\n", 320| strerror(errno)); 321|-> return 2; 322| } 323|
- Loading branch information