From 3136c7a82f39c2d461b473b3fc7f014c61021681 Mon Sep 17 00:00:00 2001 From: Garry Zacheiss Date: Wed, 28 Feb 2001 19:47:05 +0000 Subject: Fix a couple of small memory leaks, and make zephyrd not mistreat people who were trying to subscribe to acl'ed classes they weren't on the acl for. --- server/subscr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'server/subscr.c') diff --git a/server/subscr.c b/server/subscr.c index 600dd26..eb3ba27 100644 --- a/server/subscr.c +++ b/server/subscr.c @@ -164,26 +164,24 @@ add_subscriptions(who, subs, notice, server) && subs->dest.recip->string[0] != '@') { syslog(LOG_WARNING, "subscr unauth %s recipient %s", sender->string, subs->dest.recip->string); - free_subscriptions(subs); - free_string(sender); - return ZSRV_CLASSRESTRICTED; + free_subscription(subs); /* free this one - denied */ + continue; /* the for loop */ } acl = class_get_acl(subs->dest.classname); if (acl && !realm) { if (!access_check(sender->string, acl, SUBSCRIBE)) { syslog(LOG_WARNING, "subscr unauth %s class %s", sender->string, subs->dest.classname->string); - free_subscriptions(subs); - free_string(sender); - return ZSRV_CLASSRESTRICTED; + free_subscription(subs); /* free this one - denied */ + continue; /* the for loop */ } if (wildcard_instance == subs->dest.inst) { if (!access_check(sender->string, acl, INSTWILD)) { syslog(LOG_WARNING, "subscr unauth %s class %s wild inst", sender->string, subs->dest.classname->string); - free_subscriptions(subs); - return ZSRV_CLASSRESTRICTED; + free_subscription(subs); /* free this one - denied */ + continue; /* the for loop */ } } } @@ -194,6 +192,8 @@ add_subscriptions(who, subs, notice, server) free_subscriptions(subs); free_string(sender); return(retval); + } else { + free_subscription(subs); /* free this one, will get from ADD */ } } else { retval = triplet_register(who, &subs->dest, NULL); -- cgit v1.2.3