]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_expire.c
* if the message is not valid, try to free the message pointer in message_free
[citadel.git] / citadel / serv_expire.c
index e357ea615dfe7157078f4470b2c4a0280ccaeb12..542c1701f18b07e760d6423617805013db9241de 100644 (file)
@@ -126,7 +126,7 @@ void GatherPurgeMessages(struct ctdlroom *qrbuf, void *data) {
        struct ExpirePolicy epbuf;
        long delnum;
        time_t xtime, now;
-       struct CtdlMessage *msg;
+       struct CtdlMessage *msg = NULL;
        int a;
         struct cdbdata *cdbfr;
        long *msglist = NULL;
@@ -424,6 +424,10 @@ void do_user_purge(struct ctdluser *us, void *data) {
         */
        if (us->flags & US_PERM) purge = 0;
 
+       /* If the user is an Aide, don't purge him/her/it.
+        */
+       if (us->axlevel == 6) purge = 0;
+
        /* If the access level is 0, the record should already have been
         * deleted, but maybe the user was logged in at the time or something.
         * Delete the record now.
@@ -647,7 +651,7 @@ int PurgeEuidIndexTable(void) {
        struct EPurgeList *el = NULL;
        struct EPurgeList *eptr; 
        long msgnum;
-       struct CtdlMessage *msg;
+       struct CtdlMessage *msg = NULL;
 
        /* Phase 1: traverse through the table, discovering old records... */
        lprintf(CTDL_DEBUG, "Purge EUID index: phase 1\n");