1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-07-16 07:14:15 +02:00

[Issue #284] fix segfault in local timezone handling

This commit is contained in:
Grigory Smolkin
2020-12-09 03:10:26 -05:00
parent e9ddcafdf9
commit 0d65e055cf
2 changed files with 1 additions and 5 deletions

View File

@ -1256,8 +1256,6 @@ parse_time(const char *value, time_t *result, bool utc_default)
*result -= tz;
}
pg_free(local_tz);
return true;
}
@ -1528,6 +1526,4 @@ time2iso(char *buf, size_t len, time_t time, bool utc)
snprintf(ptr, len - (ptr - buf), ":%02d",
abs((int) offset % SECS_PER_HOUR) / SECS_PER_MINUTE);
}
pg_free(local_tz);
}

View File

@ -1251,7 +1251,7 @@ pgut_unsetenv(const char *key)
* leak memory.
*/
envstr = (char *) malloc(strlen(key) + 2);
envstr = (char *) pgut_malloc(strlen(key) + 2);
if (!envstr) /* not much we can do if no memory */
return;