Skip to content

Instantly share code, notes, and snippets.

@lericson
Created March 1, 2011 13:08
Show Gist options
  • Save lericson/849091 to your computer and use it in GitHub Desktop.
Save lericson/849091 to your computer and use it in GitHub Desktop.
commit 4f35913316fa452ca49f44e88963ae6b6aee71a8
Author: Ludvig Ericson <[email protected]>
Date: Tue Mar 1 13:49:33 2011 +0100
Only free gets results if results were found
Fixes issue #30
diff --git a/_pylibmcmodule.c b/_pylibmcmodule.c
index b26dab7..3dae489 100644
--- a/_pylibmcmodule.c
+++ b/_pylibmcmodule.c
@@ -467,7 +467,9 @@ static PyObject *PylibMC_Client_gets(PylibMC_Client *self, PyObject *arg) {
/* deallocate any indirect buffers, even though the struct itself
is on our stack */
- memcached_result_free(&results_obj);
+ if (results != NULL) {
+ memcached_result_free(results);
+ }
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment