diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-26 01:21:10 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-26 01:21:10 -0700 |
commit | 0bc644abf06d1cf903ed7bf59302894f80d18971 (patch) | |
tree | da229cd4505d34800af22e10c8f61d380d6a88b3 /env_universal_common.cpp | |
parent | 31b7d076b7bff8d7bb81e6a1fff58755b7baa10b (diff) |
Fix lots of bugs related to the static analyzer
Improved how screen.cpp interacts with output_set_writer()
Diffstat (limited to 'env_universal_common.cpp')
-rw-r--r-- | env_universal_common.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/env_universal_common.cpp b/env_universal_common.cpp index 7425977a..20821e46 100644 --- a/env_universal_common.cpp +++ b/env_universal_common.cpp @@ -545,28 +545,21 @@ static int match( const wchar_t *msg, const wchar_t *cmd ) void env_universal_common_set( const wchar_t *key, const wchar_t *val, int exportv ) { var_uni_entry_t *entry; - wchar_t *name; CHECK( key, ); CHECK( val, ); entry = new var_uni_entry_t; - name = wcsdup(key); - - if( !entry || !name ) - DIE_MEM(); - entry->exportv=exportv; entry->val = val; - env_universal_common_remove( name ); + env_universal_common_remove( key ); env_universal_var.insert( std::pair<wcstring, var_uni_entry_t*>(key, entry)); if( callback ) { - callback( exportv?SET_EXPORT:SET, name, val ); + callback( exportv?SET_EXPORT:SET, key, val ); } - free(name); } |