From 19a442fd9054529de731abad84852183be8ed115 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sat, 6 Dec 2008 03:17:19 +0100 Subject: Added free function eurephiaUSERLIST structs. Added possible valgrind issue. --- common/eurephia_admin_common.c | 11 ++++++++++- common/eurephia_admin_common.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/eurephia_admin_common.c b/common/eurephia_admin_common.c index 3b02fe1..8b62779 100644 --- a/common/eurephia_admin_common.c +++ b/common/eurephia_admin_common.c @@ -130,5 +130,14 @@ void _eAdminFreeUSERINFO_func(eurephiaUSERINFO *p) { free_nullsafe(p->deactivated); free_nullsafe(p->last_accessed); p->next = NULL; - free_nullsafe(p); + free(p); +} + +void _eAdminFreeUSERLIST_func(eurephiaUSERLIST *p) { + if( p == NULL ) { + return; + } + + eAdminFreeUSERINFO(p->users); + free(p); } diff --git a/common/eurephia_admin_common.h b/common/eurephia_admin_common.h index 450e700..aa6a989 100644 --- a/common/eurephia_admin_common.h +++ b/common/eurephia_admin_common.h @@ -119,4 +119,7 @@ eurephiaUSERINFO *eAdminPopulateUSERINFO(int uid, const char *uname, const char void _eAdminFreeUSERINFO_func(eurephiaUSERINFO *); #define eAdminFreeUSERINFO(x) { _eAdminFreeUSERINFO_func(x); x = NULL; } +void _eAdminFreeUSERLIST_func(eurephiaUSERLIST *); +#define eAdminFreeUSERLIST(x) { _eAdminFreeUSERLIST_func(x); x = NULL; } + #endif /* !EUREPHIA_ADMIN_COMMON_H_ */ -- cgit