X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_ovs.c;h=3c448e3e5215e2203c00cc66c4987d3ea88531b1;hb=cae3cf94780b9992dfa6bae18417f0c5b03e4fab;hp=ae82253bff2941a03dba07c108e3196d75ebd058;hpb=b27690f1217ac112e5a98cd2fc77facad9df26fc;p=collectd.git diff --git a/src/utils_ovs.c b/src/utils_ovs.c index ae82253b..3c448e3e 100644 --- a/src/utils_ovs.c +++ b/src/utils_ovs.c @@ -1003,9 +1003,10 @@ ovs_db_t *ovs_db_init(const char *node, const char *service, return NULL; /* allocate db data & fill it */ - ovs_db_t *pdb = pdb = calloc(1, sizeof(*pdb)); + ovs_db_t *pdb = calloc(1, sizeof(*pdb)); if (pdb == NULL) return NULL; + pdb->sock = -1; /* store the OVS DB address */ sstrncpy(pdb->node, node, sizeof(pdb->node)); @@ -1047,7 +1048,6 @@ ovs_db_t *ovs_db_init(const char *node, const char *service, } /* init polling thread */ - pdb->sock = -1; if (ovs_db_poll_thread_init(pdb) < 0) { ovs_db_destroy(pdb); return NULL;