commit 5caa9d80ce1ae00234a36b0cfc6b6fc4b8eb035c
Author: Priit Laes <plaes@plaes.org>
Date: Sat Apr 21 12:52:14 2007 +0300
Clean some memleaks in c2s when configuration isn't set up properly.
diff --git a/c2s/main.c b/c2s/main.c
index 9fe1300..845c0b4 100644
|
a
|
b
|
|
| 516 | 516 | |
| 517 | 517 | _c2s_pidfile(c2s); |
| 518 | 518 | |
| 519 | | if(c2s->ar_module_name == NULL) |
| 520 | | { |
| | 519 | if(c2s->ar_module_name == NULL) { |
| 521 | 520 | log_write(c2s->log, LOG_ERR, "no authreg module specified in config file"); |
| | 521 | access_free(c2s->access); |
| | 522 | config_free(c2s->config); |
| | 523 | log_free(c2s->log); |
| | 524 | free(c2s); |
| 522 | 525 | exit(1); |
| 523 | 526 | } |
| 524 | 527 | |
| 525 | | if((c2s->ar = authreg_init(c2s, c2s->ar_module_name)) == NULL) |
| | 528 | if((c2s->ar = authreg_init(c2s, c2s->ar_module_name)) == NULL) { |
| | 529 | access_free(c2s->access); |
| | 530 | config_free(c2s->config); |
| | 531 | log_free(c2s->log); |
| | 532 | free(c2s); |
| 526 | 533 | exit(1); |
| | 534 | } |
| 527 | 535 | |
| 528 | 536 | c2s->pc = prep_cache_new(); |
| 529 | 537 | |