Changeset b0da027


Ignore:
Timestamp:
Mar 1, 2010, 8:15:46 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
91634ec
Parents:
62a000b
git-author:
Anders Kaseorg <andersk@mit.edu> (02/27/10 22:29:14)
git-committer:
Anders Kaseorg <andersk@mit.edu> (03/01/10 20:15:46)
Message:
Add owl_cmd_delete to fix leaks.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Alejandro R. Sedeño <asedeno@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r62a000b rb0da027  
    5151  cmd = owl_malloc(sizeof(owl_cmd));
    5252  owl_cmd_create_alias(cmd, alias_from, alias_to);
    53   owl_dict_insert_element(cd, cmd->name, cmd, (void(*)(void*))owl_cmd_free);   
     53  owl_dict_insert_element(cd, cmd->name, cmd, (void (*)(void *))owl_cmd_delete);
    5454  return(0);
    5555}
     
    6262  }
    6363  owl_perlconfig_new_command(cmd->name);
    64   return owl_dict_insert_element(cd, newcmd->name, newcmd, (void(*)(void*))owl_cmd_free);
     64  return owl_dict_insert_element(cd, newcmd->name, newcmd, (void (*)(void *))owl_cmd_delete);
    6565}
    6666
     
    162162  if (cmd->cmd_aliased_to) owl_free(cmd->cmd_aliased_to);
    163163  if (cmd->cmd_perl) owl_perlconfig_cmd_free(cmd);
     164}
     165
     166void owl_cmd_delete(owl_cmd *cmd)
     167{
     168  owl_cmd_free(cmd);
     169  owl_free(cmd);
    164170}
    165171
Note: See TracChangeset for help on using the changeset viewer.