From 41ef42ee94f34c46ccdb9f56991fc0fe94c779df Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 15 Mar 2018 15:00:12 +1030 Subject: [PATCH] memdump: fix overzealous assertions from b857b2e8438ad86f6c69c40ec3e4db3ab6a4542a Signed-off-by: Rusty Russell --- lightningd/memdump.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lightningd/memdump.c b/lightningd/memdump.c index fba264e04..d2d536c23 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -73,8 +73,10 @@ static int json_add_syminfo(void *data, uintptr_t pc UNUSED, struct json_result *response = data; char *str; - assert(filename != NULL); - assert(function != NULL); + /* This can happen in backtraces. */ + if (!filename || !function) + return 0; + str = tal_fmt(response, "%s:%u (%s)", filename, lineno, function); json_add_string(response, NULL, str); tal_free(str);