Ticket #67: jabberd-c2s-valgrind.patch

File jabberd-c2s-valgrind.patch, 1.0 KB (added by anonymous, 19 months ago)
  • c2s/main.c

    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  
    516516 
    517517    _c2s_pidfile(c2s); 
    518518 
    519     if(c2s->ar_module_name == NULL) 
    520     { 
     519    if(c2s->ar_module_name == NULL) { 
    521520        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); 
    522525        exit(1); 
    523526    } 
    524527 
    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); 
    526533        exit(1); 
     534        } 
    527535 
    528536    c2s->pc = prep_cache_new(); 
    529537