We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d179b1c commit c71ae6eCopy full SHA for c71ae6e
1 file changed
src/postgresql/pgvalue.c
@@ -74,15 +74,18 @@ int pgvalue_dbtype(pgvalue_t *v) {
74
}
75
76
77
-static void pgvalue_vec_push(pgvalue_t ***arr, int *count, int *cap, pgvalue_t *val) {
+static bool pgvalue_vec_push(pgvalue_t ***arr, int *count, int *cap, pgvalue_t *val) {
78
if (*cap == 0) {
79
*cap = 8;
80
*arr = (pgvalue_t **)cloudsync_memory_zeroalloc(sizeof(pgvalue_t *) * (*cap));
81
+ if (*arr) return false;
82
} else if (*count >= *cap) {
83
*cap *= 2;
84
*arr = (pgvalue_t **)cloudsync_memory_realloc(*arr, sizeof(pgvalue_t *) * (*cap));
85
86
87
(*arr)[(*count)++] = val;
88
+ return true;
89
90
91
pgvalue_t **pgvalues_from_array(ArrayType *array, int *out_count) {
0 commit comments