From 53f6123eaf6286245bb59b8f4bc569da59a87504 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 21 Oct 2002 04:53:41 +0000 Subject: [PATCH] Check for NULL pointer in LT_DLMEM_REASSIGN() before freeing it. svn path=/trunk/yasm/; revision=769 --- libltdl/ltdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index e745332a..fe20917b 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -175,7 +175,7 @@ LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) #define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) #define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ - if ((p) != (q)) { lt_dlfree (p); (p) = (q); (q) = 0; } \ + if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ } LT_STMT_END