Changeset baa98ed1b2d238f912d8e21d4f6cdba3b1af1aa5

Show
Ignore:
Timestamp:
03/17/08 15:07:37 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1205766457 +0000
git-parent:

[4b96846179a35015ac0b22d5fe9e9f92480f06a5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1205766457 +0000
Message:

free leaking memory

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    r2471771 rbaa98ed  
    6767    next = q->head; 
    6868    q->head = q->head->next; 
     69    free_params(next); 
    6970    if(next->data) free(next->data); 
    7071    free(next); 
     
    113114  if(!strcmp(d->paramValues[d->nparams], "[[null]]")) { \ 
    114115    free(d->paramValues[d->nparams]); \ 
     116    d->paramValues[d->nparams] = NULL; \ 
    115117    d->paramLengths[d->nparams] = 0; \ 
    116118    d->paramAllocd[d->nparams] = 0; \ 
     
    119121} while(0) 
    120122 
     123static void 
     124free_params(ds_job_detail *d) { 
     125  int i; 
     126  for(i=0; i<d->nparams; i++) 
     127    if(d->paramAllocd[i] && d->paramValues[i]) 
     128      free(d->paramValues[i]); 
     129} 
    121130execute_outcome_t 
    122131stratcon_datastore_execute(conn_q *cq, struct sockaddr *r, ds_job_detail *d) { 
     
    258267stratcon_datastore_savepoint_op(conn_q *cq, const char *p, 
    259268                                const char *name) { 
    260   int rv
     269  int rv = -1
    261270  PGresult *res; 
    262271  char cmd[128];