Skip to content

Commit

Permalink
Update for small tweaks in xchange lib
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Dec 10, 2024
1 parent 9fd07a3 commit 633fcfe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/resp.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,13 @@ static XField *respArrayToXField(const char *name, const RESP **component, int n
// --------------------------------------------------------
// Heterogeneous array...

XField *array;

f = xCreateMixed1DField(name, n);

if(!f->value) return x_trace_null(fn, "field array");
XField *array = (XField *) calloc(n, sizeof(XField));
if(!array) {
x_error(0, errno, fn, "alloc error (%d XField)", n);
return NULL;
}

array = (XField *) f->value;
f = xCreateMixed1DField(name, n, array);

for(i = 0; i < n; i++) {
XField *e = redisxRESP2XField(array[i].name, component[i]);
Expand All @@ -608,7 +608,7 @@ static XField *respArrayToXField(const char *name, const RESP **component, int n
char *array;
size_t eSize;

if(eType == X_UNKNOWN) return xCreateMixed1DField(name, 0);
if(eType == X_UNKNOWN) return xCreateMixed1DField(name, 0, NULL);

eSize = xElementSizeOf(eType);
array = (char *) calloc(1, n * eSize);
Expand Down

0 comments on commit 633fcfe

Please sign in to comment.