Changeset d89c61f


Ignore:
Timestamp:
Mar 1, 2010, 8:33:50 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.5
Children:
a96b109
Parents:
3c0ec97
git-author:
Anders Kaseorg <andersk@mit.edu> (02/27/10 22:29:14)
git-committer:
Nelson Elhage <nelhage@mit.edu> (03/01/10 20:33:50)
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

    r3c0ec97 rd89c61f  
    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.