MySQL客户端中的内存泄漏

时间:2013-03-25 13:55:12

标签: memory-leaks mysql

我有一段简单的代码可以创建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

这是一个实际的内存泄漏?

0 个答案:

没有答案