msgtext = CC->redirect_buffer;
CC->redirect_buffer = NULL;
syslog(LOG_DEBUG, "Wordbreaking message %ld...", msgnum);
- if (StrLength(CC->redirect_buffer) == 0) {
+ if ((msgtext == NULL) || (StrLength(msgtext) == 0)) {
syslog(LOG_ALERT, "This message has a zero length. Probable data corruption.");
}
txt = SmashStrBuf(&msgtext);
}
free(tokens);
- qsort(all_msgs, num_all_msgs, sizeof(long), longcmp);
+ if (all_msgs != NULL)
+ qsort(all_msgs, num_all_msgs, sizeof(long), longcmp);
/*
* At this point, if a message appears num_tokens times in the
}
}
-
- free(all_msgs);
+ if (all_msgs != NULL)
+ free(all_msgs);
}
*fts_num_msgs = num_ret_msgs;
CtdlRegisterCleanupHook(noise_word_cleanup);
CtdlRegisterSessionHook(do_fulltext_indexing, EVT_TIMER);
}
- /* return our Subversion id for the Log */
+ /* return our module name for the log */
return "fulltext";
}