From 924d6774d5afb5ad6830e4da5eb1748972de493e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Jan 2020 12:17:03 +0000 Subject: [PATCH] Examples: fix memory leak --- examples/C/grib_get_keys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index 0fc540c5d..ac4e00cb5 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -138,6 +138,7 @@ int main(int argc, char** argv) CODES_CHECK(codes_get_size(h, name, &keySize), 0); byte_val = (unsigned char*)malloc(keySize * sizeof(char)); GRIB_CHECK(codes_get_bytes(h, name, byte_val, &keySize), name); + free(byte_val); } codes_handle_delete(h);