diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-21 17:35:32 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-21 17:35:39 -0800 |
commit | 7dd0b6cafc7e151713d379a0e171197be43fb7d0 (patch) | |
tree | 2b645bed736fbedeb4d4b10e72a1a686dcdaf12b /src/node.c | |
parent | a90d61665a3ba565d98b4dc8a1ed44170142c6bc (diff) |
Avoid free(0) for link titles and URLs.
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; |