aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/ext/google/protobuf
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2018-05-29 10:25:05 -0700
committerGravatar GitHub <noreply@github.com>2018-05-29 10:25:05 -0700
commit7d1a8fff1b424e63f6bbdd1f9f828f6f9f40e84f (patch)
tree8090ac6eb78988d1dc85543db23dd5af486ca5f5 /php/ext/google/protobuf
parent2804902446bf6f3d7d2a58fad7a053034dfcda84 (diff)
Fix php memory leak test (#4692)
Diffstat (limited to 'php/ext/google/protobuf')
-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]) {