aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2018-10-30 17:56:38 +0100
committerThomas White <taw@bitwiz.me.uk>2018-10-30 17:56:38 +0100
commit19f20ab06476f93977d1c7130b76f7c31d198936 (patch)
tree5410b960ab5b00d043a0d828299116baf38d0eeb /src/narrative_window.c
parent6171bc9d7f86ea0ac1c6abd4a213850fa4f81300 (diff)
Fix errors reported by static analyser
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 7f3690e..3f936e0 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -732,10 +732,16 @@ GActionEntry nw_entries[] = {
void update_titlebar(NarrativeWindow *nw)
{
char *title;
+ char *title_new;
title = get_titlebar_string(nw->p);
- title = realloc(title, strlen(title)+16);
- if ( title == NULL ) return;
+ title_new = realloc(title, strlen(title)+16);
+ if ( title_new == NULL ) {
+ free(title);
+ return;
+ } else {
+ title = title_new;
+ }
strcat(title, " - Colloquium");
if ( !nw->p->saved ) {