Bug 704567

Summary: Possible problems found by static analysis of code
Product: [Fedora] Fedora Reporter: Jiri Popelka <jpopelka>
Component: portreserveAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 15CC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: portreserve-0.0.5-2.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 718176 (view as bug list) Environment:
Last Closed: 2011-07-04 18:51:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 718176    
Attachments:
Description Flags
small memory leak none

Description Jiri Popelka 2011-05-13 15:45:06 UTC
Description of problem:
Static analysis of the code with/without applied patches discovered
some possible problems in the code.


Version-Release number of selected component (if applicable):
portreserve-0.0.4-8.fc15

Comment 1 Jiri Popelka 2011-05-13 15:46:22 UTC
Created attachment 498794 [details]
small memory leak

Error: RESOURCE_LEAK:
portreserve-0.0.4/src/portreserve.c:244: alloc_fn: Calling allocation function "malloc".
portreserve-0.0.4/src/portreserve.c:244: var_assign: Assigning: "cfgfile" =  storage returned from "malloc(strlen(dir) + 255UL + 1UL)".
portreserve-0.0.4/src/portreserve.c:245: var_assign: Assigning: "cfgf" = "cfgfile".
portreserve-0.0.4/src/portreserve.c:251: noescape: Variable "cfgfile" is not freed or pointed-to in function "strcpy".
portreserve-0.0.4/src/portreserve.c:254: leaked_storage: Variable "cfgf" going out of scope leaks the storage it points to.
portreserve-0.0.4/src/portreserve.c:254: leaked_storage: Variable "cfgfile" going out of scope leaks the storage it points to.
portreserve-0.0.4/src/portreserve.c:260: noescape: Variable "cfgf" is not freed or pointed-to in function "strcpy".
portreserve-0.0.4/src/portreserve.c:261: noescape: Variable "cfgfile" is not freed or pointed-to in function "reserve".
portreserve-0.0.4/src/portreserve.c:120:22: noescape: "reserve" does not free or save its pointer parameter "file".
portreserve-0.0.4/src/portreserve.c:314: leaked_storage: Variable "cfgf" going out of scope leaks the storage it points to.
portreserve-0.0.4/src/portreserve.c:314: leaked_storage: Variable "cfgfile" going out of scope leaks the storage it points to.

Comment 2 Tim Waugh 2011-05-20 15:00:27 UTC
Thanks, applied upstream.

Comment 3 Fedora Update System 2011-06-24 18:34:07 UTC
portreserve-0.0.5-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/portreserve-0.0.5-1.fc15

Comment 4 Fedora Update System 2011-06-24 18:34:46 UTC
portreserve-0.0.5-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/portreserve-0.0.5-1.fc14

Comment 5 Fedora Update System 2011-06-25 19:57:42 UTC
Package portreserve-0.0.5-1.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing portreserve-0.0.5-1.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/portreserve-0.0.5-1.fc14
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-07-04 18:50:55 UTC
portreserve-0.0.5-2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2011-07-18 22:39:53 UTC
portreserve-0.0.5-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.