summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/node.c b/src/node.c
index 9cdfbe9..fe3dac3 100644
--- a/src/node.c
+++ b/src/node.c
@@ -122,8 +122,12 @@ void S_free_nodes(cmark_node *e)
break;
case NODE_LINK:
case NODE_IMAGE:
- free(e->as.link.url);
- free(e->as.link.title);
+ if (e->as.link.url) {
+ free(e->as.link.url);
+ }
+ if (e->as.link.title) {
+ free(e->as.link.title);
+ }
break;
default:
break;