Skip to content

Commit fdfba98

Browse files
committed
fix memory leak in arrow schema
1 parent 4984c45 commit fdfba98

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libImaging/Arrow.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ ReleaseExportedSchema(struct ArrowSchema *array) {
3737
child->release = NULL;
3838
}
3939
// UNDONE -- should I be releasing the children?
40+
free(array->children[i]);
41+
}
42+
if (array->children) {
43+
free(array->children);
4044
}
4145

4246
// Release dictionary
@@ -117,6 +121,7 @@ export_imaging_schema(Imaging im, struct ArrowSchema *schema) {
117121
retval = export_named_type(schema->children[0], im->arrow_band_format, "pixel");
118122
if (retval != 0) {
119123
free(schema->children[0]);
124+
free(schema->children);
120125
schema->release(schema);
121126
return retval;
122127
}

0 commit comments

Comments
 (0)