Merge pull request #12930 from nicolasnoble/windows-memleak

Fixing Windows's memory leak.
pull/12856/head^2
Nicolas Noble 7 years ago committed by GitHub
commit 07127078e8
  1. 5
      src/core/lib/support/env_windows.cc

@ -43,7 +43,10 @@ char *gpr_getenv(const char *name) {
DWORD ret;
ret = GetEnvironmentVariable(tname, NULL, 0);
if (ret == 0) return NULL;
if (ret == 0) {
gpr_free(tname);
return NULL;
}
size = ret * (DWORD)sizeof(TCHAR);
tresult = (LPTSTR)gpr_malloc(size);
ret = GetEnvironmentVariable(tname, tresult, size);

Loading…
Cancel
Save