* @param options : list of format creation options. array of strings
* @param gdalsize : will be set to the size of returned bytea
*
- * @return formatted GDAL raster
+ * @return formatted GDAL raster. the calling function is responsible
+ * for freeing the returned data using CPLFree()
*/
uint8_t*
rt_raster_to_gdal(rt_raster raster, char *srs,
* @param options : list of format creation options. array of strings
* @param gdalsize : will be set to the size of returned bytea
*
- * @return formatted GDAL raster
+ * @return formatted GDAL raster. the calling function is responsible
+ * for freeing the returned data using CPLFree()
*/
uint8_t *rt_raster_to_gdal(rt_raster raster, char *srs,
char *format, char **options, uint64_t *gdalsize);
/* free memory */
if (NULL != options) {
- for (i = j - 1; i >= 0; i--)
- pfree(options[i]);
+ for (i = j - 1; i >= 0; i--) pfree(options[i]);
pfree(options);
}
rt_raster_destroy(raster);
fclose(fh);
*/
+ /* free gdal mem buffer */
+ if (gdal) CPLFree(gdal);
+
POSTGIS_RT_DEBUG(3, "RASTER_asGDALRaster: Returning pointer to GDAL raster");
PG_RETURN_POINTER(result);
}
fclose(fh);
*/
+ if (gdal) CPLFree(gdal);
+
deepRelease(raster);
}