Bug 3037 - cppcheck reporting error of possible memory leak
Summary: cppcheck reporting error of possible memory leak
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Regression tests (show other bugs)
Version: 8.0p1
Hardware: Other Windows 10
: P5 minor
Assignee: Jitendra Sharma
URL:
Keywords:
Depends on:
Blocks: V_8_1
  Show dependency treegraph
 
Reported: 2019-07-25 14:55 AEST by Jitendra Sharma
Modified: 2021-04-23 15:11 AEST (History)
3 users (show)

See Also:


Attachments
Proposed patch to fix the bug (2.19 KB, patch)
2019-07-25 16:12 AEST, Jitendra Sharma
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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