diff options
Diffstat (limited to 'pith/hist.c')
-rw-r--r-- | pith/hist.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pith/hist.c b/pith/hist.c index bef5598b..8f21b831 100644 --- a/pith/hist.c +++ b/pith/hist.c @@ -50,8 +50,12 @@ free_hist(HISTORY_S **history) if(history && *history){ for(i = 0; i < (*history)->histsize; i++) - if((*history)->hist[i] && (*history)->hist[i]->str) - fs_give((void **) &(*history)->hist[i]->str); + if((*history)->hist[i]){ + if((*history)->hist[i]->str) + fs_give((void **) &(*history)->hist[i]->str); + (*history)->hist[i]->cntxt = NULL; /* taken care of elsewhere */ + fs_give((void **) &(*history)->hist[i]); + } fs_give((void **) history); } |