Re: To Hannu Valtonen 2014-05-02 <20140502135529.gb14...@msgid.df7cb.de>
> Re: Hannu Valtonen 2014-05-02 <53639ce0.30...@ohmu.fi>
> > Hi,
> > 
> > This has now been fixed by: 
> > https://github.com/ohmu/pgmemcache/commit/47623a545be485d6dd1ffb917e990d267ad57f35

Hi,

we've had a closer look at this patch. Assuming pfree() is
PostgreSQL's free() variant (which I believe it is), it looks like
using pfree() was wrong in the first place, and the standard libc
free() should be used, whatever libmemcached version is used.

I think the following patch does the right thing:

Index: pgmemcache/pgmemcache.c
===================================================================
--- pgmemcache.orig/pgmemcache.c        2014-05-08 15:25:30.260692035 +0200
+++ pgmemcache/pgmemcache.c     2014-05-08 15:27:13.164195600 +0200
@@ -818,10 +818,10 @@ static memcached_return_t server_stat_fu
     {
       char *value = memcached_stat_get_value(ptr, &stat, *stat_ptr, &rc);
       appendStringInfo(context, "%s: %s\n", *stat_ptr, value);
-      libmc_stat_free(value);
+      free(value);
     }
 
-  pfree(list);
+  free(list);
   return MEMCACHED_SUCCESS;
 }
 
Index: pgmemcache/pgmemcache.h
===================================================================
--- pgmemcache.orig/pgmemcache.h        2014-05-08 15:25:30.260692035 +0200
+++ pgmemcache/pgmemcache.h     2014-05-08 15:27:13.224195312 +0200
@@ -36,13 +36,6 @@
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION
 
-/* libmemcached 1.0.16 changed the allocation function for values returned 
from memcached_stat_get_value */
-#if LIBMEMCACHED_VERSION_HEX >= 0x01000016
-  #define libmc_stat_free free
-#else
-  #define libmc_stat_free pfree
-#endif
-
 void _PG_init(void);
 void _PG_fini(void);
 


> Do you plan to release a new version, or should I apply the patch to
> the current version in Debian for now?

Christoph
-- 
c...@df7cb.de | http://www.df7cb.de/


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to