Changeset: fd1d60c3d52d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd1d60c3d52d
Modified Files:
        clients/mapiclient/mclient.c
Branch: Apr2019
Log Message:

Only call free on non-NULL pointers.


diffs (22 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1461,10 +1461,14 @@ SQLrenderer(MapiHdl hdl)
        rest = calloc(fields, sizeof(*rest));
        numeric = calloc(fields, sizeof(*numeric));
        if (len == NULL || hdr == NULL || rest == NULL || numeric == NULL) {
-               free(len);
-               free(hdr);
-               free(rest);
-               free(numeric);
+               if (len)
+                       free(len);
+               if (hdr)
+                       free(hdr);
+               if (rest)
+                       free(rest);
+               if (numeric)
+                       free(numeric);
                fprintf(stderr,"Malloc for SQLrenderer failed");
                exit(2);
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to