Skip to content

Commit 0d65e05

Browse files
committed
[Issue #284] fix segfault in local timezone handling
1 parent e9ddcaf commit 0d65e05

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/utils/configuration.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,8 +1256,6 @@ parse_time(const char *value, time_t *result, bool utc_default)
12561256
*result -= tz;
12571257
}
12581258

1259-
pg_free(local_tz);
1260-
12611259
return true;
12621260
}
12631261

@@ -1528,6 +1526,4 @@ time2iso(char *buf, size_t len, time_t time, bool utc)
15281526
snprintf(ptr, len - (ptr - buf), ":%02d",
15291527
abs((int) offset % SECS_PER_HOUR) / SECS_PER_MINUTE);
15301528
}
1531-
1532-
pg_free(local_tz);
15331529
}

src/utils/pgut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ pgut_unsetenv(const char *key)
12511251
* leak memory.
12521252
*/
12531253

1254-
envstr = (char *) malloc(strlen(key) + 2);
1254+
envstr = (char *) pgut_malloc(strlen(key) + 2);
12551255
if (!envstr) /* not much we can do if no memory */
12561256
return;
12571257

0 commit comments

Comments
 (0)