Bug 3037

Summary: cppcheck reporting error of possible memory leak
Product: Portable OpenSSH Reporter: Jitendra Sharma <jitendra.sharma>
Component: Regression testsAssignee: Jitendra Sharma <jitendra.sharma>
Status: CLOSED FIXED    
Severity: minor CC: djm, dtucker, jitendra.sharma
Priority: P5    
Version: 8.0p1   
Hardware: Other   
OS: Windows 10   
Bug Depends on:    
Bug Blocks: 2988    
Attachments:
Description Flags
Proposed patch to fix the bug none

Description Jitendra Sharma 2019-07-25 14:55:59 AEST
While executing static analysis tool cppcheck on openssh project, below errors are encountered:

[regress/unittests/test_helper/test_helper.c:404]: (error) Allocation with tohex, fprintf doesn't release it.
[regress/unittests/test_helper/test_helper.c:439]: (error) Allocation with tohex, fprintf doesn't release it.
Comment 1 Jitendra Sharma 2019-07-25 16:12:33 AEST
Created attachment 3303 [details]
Proposed patch to fix the bug

Attached is the patch which is fixing this bug reported by static analyzer tool cppcheck.

With this patch, We will get the reference of memory allocated in tohex in calling function itself and then free it.
Comment 2 Damien Miller 2019-08-30 14:42:20 AEST
This has been applied - thanks
Comment 3 Damien Miller 2021-04-23 15:11:11 AEST
closing resolved bugs as of 8.6p1 release