Skip to content

Instantly share code, notes, and snippets.

@octo
Created June 9, 2010 11:12
Show Gist options
  • Save octo/431340 to your computer and use it in GitHub Desktop.
Save octo/431340 to your computer and use it in GitHub Desktop.
diff --git a/src/python.c b/src/python.c
index 6be727e..ccc1c86 100644
--- a/src/python.c
+++ b/src/python.c
@@ -439,7 +439,7 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
v->values = list;
v->meta = dict;
ret = PyObject_CallFunctionObjArgs(c->callback, v, c->data, (void *) 0); /* New reference
- Py_XDECREF(v);
+ Py_XDECREF(&v->data);
if (ret == NULL) {
cpy_log_exception("write callback");
} else {
@@ -465,7 +465,7 @@ static int cpy_notification_callback(const notification_t *notification, user_da
sstrncpy(n->message, notification->message, sizeof(n->message));
n->severity = notification->severity;
ret = PyObject_CallFunctionObjArgs(c->callback, n, c->data, (void *) 0); /* New reference
- Py_XDECREF(n);
+ Py_XDECREF(&n->data);
if (ret == NULL) {
cpy_log_exception("notification callback");
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment