Fossil

Check-in [bee00366]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed a memleak in the th1 variadic proc args support.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | th1-query-api
Files: files | file ages | folders
SHA1:bee00366812f437af172118505a72f5cca76053c
User & Date: stephan 2012-07-22 16:54:38
References
2012-07-22
17:40
Pulled in minor memleak fix [bee0036681]. check-in: 11abffbb user: stephan tags: trunk
Context
2012-07-22
17:59
merged in trunk [11abffbb497d67a], added a test script to check a th1 memleak case. check-in: 13b0e0b4 user: stephan tags: th1-query-api
16:54
Fixed a memleak in the th1 variadic proc args support. check-in: bee00366 user: stephan tags: th1-query-api
13:11
Minor usage simplifications in the th1 argv API. check-in: 24b9fbca user: stephan tags: th1-query-api
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/th_lang.c.

369
370
371
372
373
374
375



376
377
378
379
380
381
382
  if( p->hasArgs ){
    char *zArgs = 0;
    int nArgs = 0;
    for(i=p->nParam+1; i<pArgs->argc; i++){
      Th_ListAppend(interp, &zArgs, &nArgs, pArgs->argv[i], pArgs->argl[i]);
    }
    Th_SetVar(interp, (const char *)"args", -1, zArgs, nArgs);



  }

  Th_SetResult(interp, 0, 0);
  return Th_Eval(interp, 0, p->zProgram, p->nProgram);
}

/*







>
>
>







369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
  if( p->hasArgs ){
    char *zArgs = 0;
    int nArgs = 0;
    for(i=p->nParam+1; i<pArgs->argc; i++){
      Th_ListAppend(interp, &zArgs, &nArgs, pArgs->argv[i], pArgs->argl[i]);
    }
    Th_SetVar(interp, (const char *)"args", -1, zArgs, nArgs);
    if(zArgs){
      Th_Free(interp, zArgs);
    }
  }

  Th_SetResult(interp, 0, 0);
  return Th_Eval(interp, 0, p->zProgram, p->nProgram);
}

/*