Changeset 14662


Ignore:
Timestamp:
04/19/13 14:09:58 (12 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixed memory leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/ToolkitOptions.cpp

    r14656 r14662  
    4545
    4646        /*intermediary: */
    47         char *token = NULL;
    48         char* tokenlistcopy=NULL;
     47        char *token         = NULL;
     48        char *tokenlistcopy = NULL;
    4949
    5050        /*First, because tokenizing destroys a string, copy what we have: */
    5151        tokenlistcopy= xNew<char>(strlen(tokenlist)+1);
    52         sprintf(tokenlistcopy,   "%s",tokenlist);
     52        sprintf(tokenlistcopy,"%s",tokenlist);
    5353
    5454        /*Now go through list of tokens, and look for  target, return value: */
     
    9191                token = strtok(NULL, " ");
    9292        }
     93
     94        /*Clean up and return*/
     95        xDelete<char>(tokenlistcopy);
    9396        return value;
    9497}
Note: See TracChangeset for help on using the changeset viewer.