Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fa35f2e

Browse files
anna-akentevaalubennikova
authored andcommitted
Added a NULL check after strdup() in backup.c
1 parent 4c670a0 commit fa35f2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,6 +2267,8 @@ set_cfs_datafiles(parray *files, const char *root, char *relative, size_t i)
22672267
char *relative_prev_file;
22682268

22692269
cfs_tblspc_path = strdup(relative);
2270+
if(!cfs_tblspc_path)
2271+
elog(ERROR, "Out of memory");
22702272
len = strlen("/pg_compression");
22712273
cfs_tblspc_path[strlen(cfs_tblspc_path) - len] = 0;
22722274
elog(VERBOSE, "CFS DIRECTORY %s, pg_compression path: %s", cfs_tblspc_path, relative);

0 commit comments

Comments
 (0)