projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
free our bson record after the write as not to leak memory
[collectd.git]
/
src
/
write_mongodb.c
diff --git
a/src/write_mongodb.c
b/src/write_mongodb.c
index
704ac07
..
4deb24d
100644
(file)
--- a/
src/write_mongodb.c
+++ b/
src/write_mongodb.c
@@
-92,6
+92,7
@@
static int wm_write (const data_set_t *ds, /* {{{ */
else
assert (23 == 42);
}
else
assert (23 == 42);
}
+ /* We must finish the record, other wise the insert will fail */
bson_finish(&record);
pthread_mutex_lock (&node->lock);
bson_finish(&record);
pthread_mutex_lock (&node->lock);
@@
-129,6
+130,8
@@
static int wm_write (const data_set_t *ds, /* {{{ */
}
pthread_mutex_unlock (&node->lock);
}
pthread_mutex_unlock (&node->lock);
+ /* free our resource as not to leak memory */
+ bson_destroy(&record);
return (0);
} /* }}} int wm_write */
return (0);
} /* }}} int wm_write */