Skip to content

Commit 6202c60

Browse files
committed
Fix segmentation fault
As reported by Maxim Zhukov, the commit 9ca7710 ("Fix memory leak in main view (#931)", 01-06-2019) causes a SIGSEGV when holding the key 'Stage/Unstage current line' in stage view. Add a check to avoid null pointer dereference. Fixes #971
1 parent 89c8fa2 commit 6202c60

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/graph-v2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ done_graph(struct graph *graph_ref)
257257
{
258258
struct graph_v2 *graph = graph_ref->private;
259259

260-
htab_delete(graph->colors.id_map);
260+
if (graph->colors.id_map)
261+
htab_delete(graph->colors.id_map);
261262

262263
free(graph);
263264

0 commit comments

Comments
 (0)