Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • scripts
  • kconfig
  • expr.c
Find file BlameHistoryPermalink
  • Ulf Magnusson's avatar
    kconfig: Fix expr_free() E_NOT leak · f52bf071
    Ulf Magnusson authored Oct 08, 2017
    [ Upstream commit 5b1374b3
    
     ]
    
    Only the E_NOT operand and not the E_NOT node itself was freed, due to
    accidentally returning too early in expr_free(). Outline of leak:
    
    	switch (e->type) {
    	...
    	case E_NOT:
    		expr_free(e->left.expr);
    		return;
    	...
    	}
    	*Never reached, 'e' leaked*
    	free(e);
    
    Fix by changing the 'return' to a 'break'.
    
    Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
    
    	LEAK SUMMARY:
    	   definitely lost: 44,448 bytes in 1,852 blocks
    	   ...
    
    Summary after the fix:
    
    	LEAK SUMMARY:
    	   definitely lost: 1,608 bytes in 67 blocks
    	   ...
    
    Signed-off-by: default avatarUlf Magnusson <ulfalizer@gmail.com>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f52bf071
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7