X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsitemap.c;fp=webcit%2Fsitemap.c;h=c79c82441d38f95a86fdf8016613e7e09165b9e6;hb=494d819637ac8aeb02ec10d2d514edb189a71f1b;hp=37fe310a80ba696f69fc3dc6cc18bfea5e875be8;hpb=fb6d573c664ecb062b96be90c59906ed9bbe82ae;p=citadel.git diff --git a/webcit/sitemap.c b/webcit/sitemap.c index 37fe310a8..c79c82441 100644 --- a/webcit/sitemap.c +++ b/webcit/sitemap.c @@ -129,11 +129,11 @@ void sitemap_do_wiki(void) { * Entry point for RSS feed generator */ void sitemap(void) { - HashList *roomlist; - HashPos *it; - long HKlen; - const char *HashKey; - folder *room; + HashList *roomlist = NULL; + HashPos *it = NULL; + long HKlen = 0; + const char *HashKey = NULL; + folder *room = NULL; output_headers(0, 0, 0, 0, 1, 0); hprintf("Content-type: text/xml\r\n"); @@ -149,7 +149,9 @@ void sitemap(void) { wc_printf("\r\n"); roomlist = GetRoomListHashLKRA(NULL, NULL); + if (!roomlist) syslog(LOG_CRIT, "GetRoomListHashLKRA() FAILED!"); it = GetNewHashPos(roomlist, 0); + if (!it) syslog(LOG_CRIT, "GetNewHashPos() FAILED!"); while (GetNextHashPos(roomlist, it, &HKlen, &HashKey, (void *)&room)) { @@ -172,8 +174,7 @@ void sitemap(void) { } DeleteHashPos(&it); - /* No need to DeleteHash(&roomlist) -- it will be freed when the session closes */ - + DeleteHash(&WC->Rooms); /* roomlist is actually a pointer to WC->Rooms */ wc_printf("\r\n"); wDumpContent(0); }