1

MySQL 接続を作成する簡単なコードがあります。

MYSQL *conn = mysql_init(NULL);
if(conn == NULL){
    fprintf(stderr, "Error: can't create MySQL-descriptor\n");
    exit(1);
}

if(!mysql_real_connect(conn,"my_host.com","my_server","psw",NULL,NULL,NULL,0)){
    fprintf(stderr, "Error: can't connect to database %s\n", mysql_error(conn));
} else {
    fprintf(stdout, "MySQL connect Success!\n");
} 
mysql_close(conn);

valgrind は次のように述べています。

==3283== LEAK SUMMARY:
==3283==    definitely lost: 0 bytes in 0 blocks
==3283==    indirectly lost: 0 bytes in 0 blocks
==3283==    possibly lost: 0 bytes in 0 blocks
==3283==    still reachable: 61,512 bytes in 17 blocks
==3283==    suppressed: 0 bytes in 0 blocks

それは実際のメモリリークですか?

4

0 に答える 0