Project

General

Profile

Actions

Bug #2253

closed

SecPublicInfoSqlite3 memory leak

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Security
Target version:
Start date:
12/01/2014
Due date:
% Done:

100%

Estimated time:
0.50 h

Description

Snippet to reproduce:

int
main() {
  KeyChain keyChain;

  return 0;
}

Command line: valgrind --leak-check=full ./a.out

Output:

==15176== HEAP SUMMARY:
==15176==     in use at exit: 84,568 bytes in 153 blocks
==15176==   total heap usage: 596 allocs, 443 frees, 195,985 bytes allocated
==15176== 
==15176== 80 bytes in 1 blocks are possibly lost in loss record 22 of 67
==15176==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15176==    by 0x5F8B73E: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F69238: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F70B17: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5FDE9FC: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F9E949: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5FDEF26: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x4A1417: ndn::SecPublicInfoSqlite3::SecPublicInfoSqlite3() (sec-public-info-sqlite3.cpp:119)
==15176==    by 0x439858: ndn::KeyChain::KeyChain() (key-chain.cpp:82)
==15176==    by 0x439058: main (in /home/shijunxiao/snippet/a.out)
==15176== 
==15176== 84,488 (880 direct, 83,608 indirect) bytes in 1 blocks are definitely lost in loss record 67 of 67
==15176==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15176==    by 0x5F8B73E: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F69238: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F70B17: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5F70B44: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x5FDEB91: ??? (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==15176==    by 0x4A1417: ndn::SecPublicInfoSqlite3::SecPublicInfoSqlite3() (sec-public-info-sqlite3.cpp:119)
==15176==    by 0x439858: ndn::KeyChain::KeyChain() (key-chain.cpp:82)
==15176==    by 0x439058: main (in /home/shijunxiao/snippet/a.out)
Actions #1

Updated by Junxiao Shi about 10 years ago

Probable cause: SecPublicInfoSqlite3 constructor calls sqlite3_open_v2, but there's no call to sqlite3_close_v2 in this class.

Actions #2

Updated by Junxiao Shi about 10 years ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
Actions #3

Updated by Junxiao Shi about 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #4

Updated by Junxiao Shi about 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF