aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/ext
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2018-05-29 10:25:05 -0700
committerGravatar Bo Yang <teboring@google.com>2018-05-29 10:27:32 -0700
commit5bf35ecca2c2f3863788d0e551a633c42a2b51ff (patch)
treeab1f41f7412f7b52863314397d49a1da2cc016f2 /php/ext
parentedaaea01f69cb9927813a5fe55093b8faacebb97 (diff)
Fix php memory leak test (#4692)
Diffstat (limited to 'php/ext')
-rw-r--r--php/ext/google/protobuf/def.c1
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]) {