ovs_db_destroy() was called before the field was initialized, leading to
close(0) being called.
ovs_db_t *pdb = calloc(1, sizeof(*pdb));
if (pdb == NULL)
return NULL;
ovs_db_t *pdb = calloc(1, sizeof(*pdb));
if (pdb == NULL)
return NULL;
/* store the OVS DB address */
sstrncpy(pdb->node, node, sizeof(pdb->node));
/* store the OVS DB address */
sstrncpy(pdb->node, node, sizeof(pdb->node));
}
/* init polling thread */
}
/* init polling thread */
if (ovs_db_poll_thread_init(pdb) < 0) {
ovs_db_destroy(pdb);
return NULL;
if (ovs_db_poll_thread_init(pdb) < 0) {
ovs_db_destroy(pdb);
return NULL;