From 7c2ea0fa5489a39f5ae35c973e9024f153d00a9b Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Sat, 16 Dec 2023 10:04:42 +0100 Subject: [PATCH] Fix mem leaks --- src/grdmix.c | 2 ++ src/grdview.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/grdmix.c b/src/grdmix.c index cd8782a7490..2ba326b6ffd 100644 --- a/src/grdmix.c +++ b/src/grdmix.c @@ -101,6 +101,8 @@ static void *New_Ctrl (struct GMT_CTRL *GMT) { /* Allocate and initialize a new static void Free_Ctrl (struct GMT_CTRL *GMT, struct GRDMIX_CTRL *C) { /* Deallocate control structure */ if (!C) return; gmt_M_str_free (C->A.file); + gmt_M_str_free (C->C.file); + gmt_M_str_free (C->C.savecpt); gmt_M_str_free (C->G.file); gmt_M_str_free (C->I.file); gmt_M_str_free (C->W.file); diff --git a/src/grdview.c b/src/grdview.c index 867fe70fa71..1f5528f1b1f 100644 --- a/src/grdview.c +++ b/src/grdview.c @@ -409,6 +409,7 @@ static void Free_Ctrl (struct GMT_CTRL *GMT, struct GRDVIEW_CTRL *C) { /* Deallo if (!C) return; gmt_M_str_free (C->In.file); gmt_M_str_free (C->C.file); + gmt_M_str_free (C->C.savecpt); for (i = 0; i < 3; i++) gmt_M_str_free (C->G.file[i]); gmt_M_str_free (C->I.file); gmt_M_str_free (C->I.azimuth);