Changeset 4597

Show
Ignore:
Timestamp:
11/06/08 15:05:58 (2 months ago)
Author:
martin
Message:

fixed leak
fixed build if !HAVE_BACKTRACE

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/libstrongswan/utils/backtrace.c

    r4585 r4597  
    104104                    fputc(c, file); 
    105105                } 
     106                pclose(output); 
    106107            } 
    107108            else 
     
    164165    private_backtrace_t *this; 
    165166    void *frames[50]; 
    166     int frame_count
     167    int frame_count = 0
    167168     
     169#ifdef HAVE_BACKTRACE 
    168170    frame_count = backtrace(frames, countof(frames)); 
     171#endif /* HAVE_BACKTRACE */ 
     172    frame_count = max(frame_count - skip, 0); 
    169173    this = malloc(sizeof(private_backtrace_t) + frame_count * sizeof(void*)); 
    170     this->frame_count = frame_count - skip
    171     memcpy(this->frames, frames + skip, this->frame_count * sizeof(void*))
     174    memcpy(this->frames, frames + skip, frame_count * sizeof(void*))
     175    this->frame_count = frame_count
    172176     
    173177    this->public.log = (void(*)(backtrace_t*,FILE*))log_;