diff --git a/php/ext/google/protobuf/names.c b/php/ext/google/protobuf/names.c index 212aded35b..87ac40de76 100644 --- a/php/ext/google/protobuf/names.c +++ b/php/ext/google/protobuf/names.c @@ -285,8 +285,10 @@ bool IsPreviouslyUnreservedClassName(const char* fullname) { int j; for (j = 0; kPreviouslyUnreservedNames[j]; j++) { if (strcmp(kPreviouslyUnreservedNames[j], lower) == 0) { + free(lower); return true; } } + free(lower); return false; }