diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index 9af76be257e5c34e173d433e6f6b68188a482ca8..834113488c99826634dd1bf00c8ca6bb9e2e0b79 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -1032,6 +1032,7 @@ static void test_get_well_known_google_credentials_file_path(void) {
   GPR_ASSERT(path == NULL);
 #endif /* GPR_POSIX_ENV || GPR_LINUX_ENV */
   gpr_setenv("HOME", old_home);
+  gpr_free(old_home);
 #else /* GPR_POSIX_FILE */
   char *path = grpc_get_well_known_google_credentials_file_path();
   GPR_ASSERT(path != NULL);