diff options
author | Vitaly Novichkov <Wohlstand@users.noreply.github.com> | 2018-06-07 11:31:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 11:31:50 +0300 |
commit | 66923df807a6cece8872e1ffeed36001c02df4fa (patch) | |
tree | bf8aae0e306f4f920a86b250822d955cc471a747 | |
parent | d20e00f43f38c891be7ca9d01dc1aea091a49f56 (diff) | |
parent | 04ea6707d9d0922b001c373d7f67fdfa5d93e44f (diff) | |
download | libADLMIDI-66923df807a6cece8872e1ffeed36001c02df4fa.tar.gz libADLMIDI-66923df807a6cece8872e1ffeed36001c02df4fa.tar.bz2 libADLMIDI-66923df807a6cece8872e1ffeed36001c02df4fa.zip |
Merge pull request #107 from jpcima/uninitialized-memory
fix a use of uninitialized memory
-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); }; |