diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2018-05-29 10:25:05 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2018-05-29 10:27:32 -0700 |
commit | 5bf35ecca2c2f3863788d0e551a633c42a2b51ff (patch) | |
tree | ab1f41f7412f7b52863314397d49a1da2cc016f2 /php/ext | |
parent | edaaea01f69cb9927813a5fe55093b8faacebb97 (diff) | |
download | protobuf-5bf35ecca2c2f3863788d0e551a633c42a2b51ff.tar.gz protobuf-5bf35ecca2c2f3863788d0e551a633c42a2b51ff.tar.bz2 protobuf-5bf35ecca2c2f3863788d0e551a633c42a2b51ff.zip |
Fix php memory leak test (#4692)
Diffstat (limited to 'php/ext')
-rw-r--r-- | php/ext/google/protobuf/def.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index cb2c7201..fa33830b 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -773,6 +773,7 @@ static size_t classname_len_max(const char *fullname, static bool is_reserved(const char *segment, int length) { bool result; char* lower = ALLOC_N(char, length + 1); + memset(lower, 0, length + 1); memcpy(lower, segment, length); int i = 0; while(lower[i]) { |