diff options
author | JP Cimalando <jpcima@users.noreply.github.com> | 2018-06-06 16:40:09 +0200 |
---|---|---|
committer | JP Cimalando <jpcima@users.noreply.github.com> | 2018-06-06 17:17:20 +0200 |
commit | 04ea6707d9d0922b001c373d7f67fdfa5d93e44f (patch) | |
tree | eff88aa1cc49da8e4f3dea7ff09810b1bae05918 /src/adlmidi_private.hpp | |
parent | d8142ef298fa4ce54a8dbf8977709b9209c148e6 (diff) | |
download | libADLMIDI-04ea6707d9d0922b001c373d7f67fdfa5d93e44f.tar.gz libADLMIDI-04ea6707d9d0922b001c373d7f67fdfa5d93e44f.tar.bz2 libADLMIDI-04ea6707d9d0922b001c373d7f67fdfa5d93e44f.zip |
fix a use of uninitialized memory
Diffstat (limited to 'src/adlmidi_private.hpp')
-rw-r--r-- | src/adlmidi_private.hpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 3aaeaf0..ed654ac 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -781,15 +781,21 @@ public: AdlChannel(const AdlChannel &oth): koff_time_until_neglible(oth.koff_time_until_neglible) { - users_assign(oth.users_first, oth.users_size); + if(oth.users_first) + { + users_first = NULL; + users_assign(oth.users_first, oth.users_size); + } + else + users_clear(); } AdlChannel &operator=(const AdlChannel &oth) - { - koff_time_until_neglible = oth.koff_time_until_neglible; - users_assign(oth.users_first, oth.users_size); - return *this; - } + { + koff_time_until_neglible = oth.koff_time_until_neglible; + users_assign(oth.users_first, oth.users_size); + return *this; + } void AddAge(int64_t ms); }; |