Ticket #163: jabberd2_fix_missing_calls_to_fclose_and_va_end.diff

File jabberd2_fix_missing_calls_to_fclose_and_va_end.diff, 4.1 KB (added by markdoliner, 15 months ago)
  • resolver/resolver.c

     
    5454 
    5555    if(fprintf(f, "%d", pid) < 0) { 
    5656        log_write(r->log, LOG_ERR, "couldn't write to %s: %s", pidfile, strerror(errno)); 
     57        fclose(f); 
    5758        return; 
    5859    } 
    5960 
     
    251252                } 
    252253#endif 
    253254 
    254                 /* !!! pull the list of mechanirs, and choose the best one. 
     255                /* !!! pull the list of mechanisms, and choose the best one. 
    255256                 *     if there isn't an appropriate one, error and bail */ 
    256257 
    257258                /* authenticate */ 
  • sm/mod_disco.c

     
    8989    xhash_put(dest, jid_full(svc->jid), (void *) svc); 
    9090} 
    9191 
    92 /** unify the contest of dyn and stat */ 
     92/** unify the contents of dyn and stat */ 
    9393static void _disco_unify_lists(disco_t d) { 
    9494    log_debug(ZONE, "unifying lists"); 
    9595 
     
    333333 
    334334        svc->jid = jid_dup(pkt->from); 
    335335 
    336         svc->features = xhash_new(9); 
     336        svc->features = xhash_new(11); 
    337337 
    338338        /* link it in */ 
    339339        xhash_put(d->dyn, jid_full(svc->jid), (void *) svc); 
     
    478478        pkt_id(pkt, result); 
    479479        pkt_free(pkt); 
    480480 
    481         /* if they have privs, them show them any administrative things they can disco to */ 
     481        /* if they have privs, then show them any administrative things they can disco to */ 
    482482        if(aci_check(mod->mm->sm->acls, "disco", result->to)) { 
    483483            nad_append_elem(result->nad, NAD_ENS(result->nad, 2), "item", 3); 
    484484            nad_append_attr(result->nad, -1, "jid", mod->mm->sm->id); 
  • sm/main.c

     
    8080 
    8181    if(fprintf(f, "%d", pid) < 0) { 
    8282        log_write(sm->log, LOG_ERR, "couldn't write to %s: %s", pidfile, strerror(errno)); 
     83        fclose(f); 
    8384        return; 
    8485    } 
    8586 
  • c2s/main.c

     
    5656 
    5757    if(fprintf(f, "%d", pid) < 0) { 
    5858        log_write(c2s->log, LOG_ERR, "couldn't write to %s: %s", pidfile, strerror(errno)); 
     59        fclose(f); 
    5960        return; 
    6061    } 
    6162 
  • sx/sx.c

     
    315315    sz = pos - message; 
    316316    va_start(ap, msgfmt); 
    317317    vsnprintf(pos, MAX_DEBUG - sz, msgfmt, ap); 
     318    va_end(ap); 
    318319    fprintf(stderr,"%s", message); 
    319320    fprintf(stderr, "\n"); 
    320321    fflush(stderr); 
  • s2s/main.c

     
    5252 
    5353    if(fprintf(f, "%d", pid) < 0) { 
    5454        log_write(s2s->log, LOG_ERR, "couldn't write to %s: %s", pidfile, strerror(errno)); 
     55        fclose(f); 
    5556        return; 
    5657    } 
    5758 
  • router/main.c

     
    5252 
    5353    if(fprintf(f, "%d", pid) < 0) { 
    5454        log_write(r->log, LOG_ERR, "couldn't write to %s: %s", pidfile, strerror(errno)); 
     55        fclose(f); 
    5556        return; 
    5657    } 
    5758 
  • mio/mio_impl.h

     
    8484    va_start(ap,msgfmt); 
    8585    fprintf(stderr,"mio.c#%d: ",line); 
    8686    vfprintf(stderr,msgfmt,ap); 
     87    va_end(ap); 
    8788    fprintf(stderr,"\n"); 
    8889} 
    8990 
  • util/log.c

     
    192198    sz = pos - message; 
    193199    va_start(ap, msgfmt); 
    194200    vsnprintf(pos, MAX_DEBUG - sz, msgfmt, ap); 
     201    va_end(ap); 
    195202    fprintf(stderr,"%s", message); 
    196203    fprintf(stderr, "\n"); 
    197204    fflush(stderr);