return NULL;
}
- tokenPrivs = (PTOKEN_PRIVILEGES) malloc(length);
+ tokenPrivs = (PTOKEN_PRIVILEGES) pg_malloc_extended(length,
+ MCXT_ALLOC_NO_OOM);
if (tokenPrivs == NULL)
{
write_stderr(_("%s: out of memory\n"), progname);
char *slpos;
char *pos;
- buf = strdup(item);
- if (!buf)
- return false;
+ buf = pg_strdup(item);
/* user or group name is string up to = */
eqpos = copyAclUserName(grantee, buf);
if (*eqpos != '=')
{
- free(buf);
+ pg_free(buf);
return false;
}
slpos = copyAclUserName(grantor, slpos);
if (*slpos != '\0')
{
- free(buf);
+ pg_free(buf);
return false;
}
}
else
{
- free(buf);
+ pg_free(buf);
return false;
}
appendPQExpBuffer(privs, "(%s)", subname);
}
- free(buf);
+ pg_free(buf);
return true;
}
{
if (search_directory(directory, fname))
{
- private->inpath = strdup(directory);
+ private->inpath = pg_strdup(directory);
return;
}
snprintf(fpath, MAXPGPATH, "%s/%s", directory, XLOGDIR);
if (search_directory(fpath, fname))
{
- private->inpath = strdup(fpath);
+ private->inpath = pg_strdup(fpath);
return;
}
}
/* current directory */
if (search_directory(".", fname))
{
- private->inpath = strdup(".");
+ private->inpath = pg_strdup(".");
return;
}
/* XLOGDIR */
if (search_directory(XLOGDIR, fname))
{
- private->inpath = strdup(XLOGDIR);
+ private->inpath = pg_strdup(XLOGDIR);
return;
}
snprintf(fpath, MAXPGPATH, "%s/%s", datadir, XLOGDIR);
if (search_directory(fpath, fname))
{
- private->inpath = strdup(fpath);
+ private->inpath = pg_strdup(fpath);
return;
}
}
char *bufptr;
size_t slen = strlen(comment_arg);
- cmdbuf = malloc(slen * 2 + 256);
+ cmdbuf = pg_malloc_extended(slen * 2 + 256, MCXT_ALLOC_NO_OOM);
if (!cmdbuf)
return fail_lo_xact("\\lo_import", own_transaction);
sprintf(cmdbuf, "COMMENT ON LARGE OBJECT %u IS '", loid);