Changeset 91a6b20


Ignore:
Timestamp:
Sep 27, 2013 4:07:40 PM (6 years ago)
Author:
Mei-Hui Su <mei@…>
Branches:
abac0-leak, master
Children:
80f0770
Parents:
f2622ee
Message:

1) add cleanup for options(leak)

Location:
libabac
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libabac/options.c

    r461541a r91a6b20  
    1919    );
    2020    exit(1);
     21}
     22
     23void free_options(options_t *opts)
     24{
     25    if(opts->keystore) free(opts->keystore);
     26    if(opts->role) free(opts->role);
     27    if(opts->principal) free(opts->principal);
     28    if(opts->rulefile) free(opts->rulefile);
    2129}
    2230
  • libabac/options.h

    r461541a r91a6b20  
    1414
    1515void get_options(int argc, char **argv, options_t *opts);
     16void free_options(options_t *opts);
    1617
    1718#ifdef __cplusplus
  • libabac/prover.c

    r4f79997 r91a6b20  
    5757    );
    5858
     59
    5960    if (success)
    6061        puts("success");
     
    7374    abac_context_credentials_free(credentials);
    7475    abac_context_free(ctx);
     76    free_options(&opts);
    7577
    7678    if(success) {
Note: See TracChangeset for help on using the changeset viewer.