INN commit: branches/2.5/nnrpd (post.c)
INN Commit
rra at isc.org
Sun Sep 26 16:02:18 UTC 2010
Date: Sunday, September 26, 2010 @ 09:02:18
Author: iulius
Revision: 9126
Do not forget to free a pointer.
Modified:
branches/2.5/nnrpd/post.c
--------+
post.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
Modified: post.c
===================================================================
--- post.c 2010-09-26 16:00:38 UTC (rev 9125)
+++ post.c 2010-09-26 16:02:18 UTC (rev 9126)
@@ -1050,11 +1050,17 @@
if ((error = ValidNewsgroups(HDR(HDR__NEWSGROUPS), &modgroup)) != NULL)
return error;
- if ((error = ProcessHeaders(i, idbuff, ihave, modgroup != NULL)) != NULL)
+ if ((error = ProcessHeaders(i, idbuff, ihave, modgroup != NULL)) != NULL) {
+ if (modgroup != NULL)
+ free(modgroup);
return error;
+ }
- if (i == 0 && HDR(HDR__CONTROL) == NULL)
+ if (i == 0 && HDR(HDR__CONTROL) == NULL) {
+ if (modgroup != NULL)
+ free(modgroup);
return "Article is empty";
+ }
strlcpy(frombuf, HDR(HDR__FROM), sizeof(frombuf));
for (i = 0, p = frombuf;p < frombuf + sizeof(frombuf);)
@@ -1149,6 +1155,7 @@
if (idbuff != NULL) {
const char *retstr;
retstr = MailArticle(modgroup, article);
+ /* MailArticle frees modgroup. */
strlcpy (idbuff, "(mailed to moderator)", SMBUF);
return retstr;
}
More information about the inn-committers
mailing list