X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Futils_ovs.c;h=2df9f2b0ebe8fb53e7d0e7ac4d9329dcaaaaca22;hp=5a8090e3cec2a4900c7f8b42a58fe4e84016628e;hb=072244d2e10336241610a1a0448a8149e9c77e7e;hpb=6f08f35672576fccfce8f2dc5077d2f3ed73febe diff --git a/src/utils_ovs.c b/src/utils_ovs.c index 5a8090e3..2df9f2b0 100644 --- a/src/utils_ovs.c +++ b/src/utils_ovs.c @@ -997,9 +997,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)); @@ -1041,7 +1042,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;