Skip to content

Commit

Permalink
older pgsql version lack guc_strdup
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Dec 5, 2024
1 parent 0cdabd8 commit 845a984
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,28 @@ http_strtolower(const char *input)
}


#if PG_VERSION_NUM < 160000
static char *
guc_strdup(int elevel, const char *src)
{
char *data;

data = pstrdup(src);
if (data == NULL)
ereport(elevel,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
return data;
}

static void
guc_free(void *ptr)
{
pfree(ptr);
}
#endif


static void
http_guc_init_opt(http_curlopt *opt)
{
Expand Down

0 comments on commit 845a984

Please sign in to comment.