summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6cb559d)
vsocket->conn_mutex was allocated with pthread_mutex_init() but never
freed with pthread_mutex_destroy(). This is a potential memory leak,
depending on how pthread_mutex_t is implemented.
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);
if (vsocket->reconnect && reconn_tid == 0) {
if (vhost_user_reconnect_init() < 0) {
vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);
if (vsocket->reconnect && reconn_tid == 0) {
if (vhost_user_reconnect_init() < 0) {
+ pthread_mutex_destroy(&vsocket->conn_mutex);
free(vsocket->path);
free(vsocket);
goto out;
free(vsocket->path);
free(vsocket);
goto out;
}
ret = create_unix_socket(vsocket);
if (ret < 0) {
}
ret = create_unix_socket(vsocket);
if (ret < 0) {
+ pthread_mutex_destroy(&vsocket->conn_mutex);
free(vsocket->path);
free(vsocket);
goto out;
free(vsocket->path);
free(vsocket);
goto out;
}
pthread_mutex_unlock(&vsocket->conn_mutex);
}
pthread_mutex_unlock(&vsocket->conn_mutex);
+ pthread_mutex_destroy(&vsocket->conn_mutex);
free(vsocket->path);
free(vsocket);
free(vsocket->path);
free(vsocket);