From 74b50d8c01f53fdd201f262fa14c59b116fbbb73 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 3 May 2010 16:41:45 +0000 Subject: [PATCH] * Eliminate generic_free_handler() since it is not needed --- citadel/modules/calendar/serv_calendar.c | 2 +- citadel/modules/expire/serv_expire.c | 2 +- citadel/modules/openid/serv_openid_rp.c | 4 ++-- citadel/modules/xmpp/xmpp_presence.c | 3 +-- libcitadel/lib/hash.c | 9 --------- libcitadel/lib/libcitadel.h | 1 - 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index 5cb20dbc9..2e6993447 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -1706,7 +1706,7 @@ void ical_putics_grabtzids(icalparameter *param, void *data) HashList *keys = (HashList *) data; if ( (keys) && (tzid) && (!IsEmptyStr(tzid)) ) { - Put(keys, tzid, strlen(tzid), strdup(tzid), generic_free_handler); + Put(keys, tzid, strlen(tzid), strdup(tzid), NULL); } } diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index 6bdf67068..ac1a6f8aa 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -831,7 +831,7 @@ int PurgeStaleOpenIDassociations(void) { memcpy(&usernum, cdboi->ptr, sizeof(long)); if (CtdlGetUserByNumber(&usbuf, usernum) != 0) { deleteme = strdup(cdboi->ptr + sizeof(long)), - Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler); + Put(keys, deleteme, strlen(deleteme), deleteme, NULL); } } cdb_free(cdboi); diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/modules/openid/serv_openid_rp.c index 16f189e0d..79c10dd5d 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/modules/openid/serv_openid_rp.c @@ -159,7 +159,7 @@ void openid_purge(struct ctdluser *usbuf) { memcpy(&usernum, cdboi->ptr, sizeof(long)); if (usernum == usbuf->usernum) { deleteme = strdup(cdboi->ptr + sizeof(long)), - Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler); + Put(keys, deleteme, strlen(deleteme), deleteme, NULL); } } cdb_free(cdboi); @@ -734,7 +734,7 @@ void cmd_oidf(char *argbuf) { extract_token(thiskey, buf, 0, '|', sizeof thiskey); extract_token(thisdata, buf, 1, '|', sizeof thisdata); CtdlLogPrintf(CTDL_DEBUG, "%s: [%d] %s\n", thiskey, strlen(thisdata), thisdata); - Put(keys, thiskey, strlen(thiskey), strdup(thisdata), generic_free_handler); + Put(keys, thiskey, strlen(thiskey), strdup(thisdata), NULL); } diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index c222b086c..ca33d1e57 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -317,8 +317,7 @@ void xmpp_massacre_roster(void) xmpp_destroy_buddy(cptr[i].cs_inet_email); if (mortuary) { char *buddy = strdup(cptr[i].cs_inet_email); - Put(mortuary, buddy, strlen(buddy), - buddy, generic_free_handler); + Put(mortuary, buddy, strlen(buddy), buddy, NULL); } } } diff --git a/libcitadel/lib/hash.c b/libcitadel/lib/hash.c index ac6a377ff..684dc466d 100644 --- a/libcitadel/lib/hash.c +++ b/libcitadel/lib/hash.c @@ -955,15 +955,6 @@ void SortByPayload(HashList *Hash, CompareFunc SortBy) */ -/* - * Generic function to free a pointer. This can be used as a callback with the - * hash table, even on systems where free() is defined as a macro or has had other - * horrible things done to it. - */ -void generic_free_handler(void *ptr) { - free(ptr); -} - /* * Generic function to free a reference. * since a reference actualy isn't needed to be freed, do nothing. diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 70f14cc96..9cd807e9d 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -411,7 +411,6 @@ void SortByHashKeyStr(HashList *Hash); int GetCount(HashList *Hash); const void *GetSearchPayload(const void *HashVoid); void SortByPayload(HashList *Hash, CompareFunc SortBy); -void generic_free_handler(void *ptr); void reference_free_handler(void *ptr); int HashLittle(const void *key, size_t length); -- 2.30.2