projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b5043b
)
src/utils_ovs.c: Initialize pdb->sock to -1 earlier.
author
Florian Forster
<octo@collectd.org>
Mon, 20 Nov 2017 10:13:02 +0000
(11:13 +0100)
committer
Florian Forster
<octo@collectd.org>
Mon, 20 Nov 2017 10:13:07 +0000
(11:13 +0100)
ovs_db_destroy() was called before the field was initialized, leading to
close(0) being called.
src/utils_ovs.c
patch
|
blob
|
history
diff --git
a/src/utils_ovs.c
b/src/utils_ovs.c
index
e3f5caa
..
3c448e3
100644
(file)
--- a/
src/utils_ovs.c
+++ b/
src/utils_ovs.c
@@
-1006,6
+1006,7
@@
ovs_db_t *ovs_db_init(const char *node, const char *service,
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;