From 5955f44adea310b735aae307407a807d7acd74c0 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Sun, 16 Nov 2014 12:26:20 +0100 Subject: Fix warnings: window.c: winframe_remove(): Np dereference: FP. Problem : Dereference of null pointer @ 2196. Diagnostic : False positive. Rationale : Suggested error path implies `frp->child == NULL` while being under condition `frp2->fr_layout == frp->fr_layout`, which is impossible: - If frp2 is frp's parent, then frp2's layout is FR_COL or FR_ROW; - if frp->child is NULL, the frp's layout is FR_LEAF. - Therefore, they can't be equal. Resolution : Assert frp->child not null. --- src/nvim/window.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/window.c b/src/nvim/window.c index 0ca3b1ca34..96f074c9a5 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2194,6 +2194,7 @@ winframe_remove ( * the frames into this list. */ if (frp2->fr_child == frp) frp2->fr_child = frp->fr_child; + assert(frp->fr_child); frp->fr_child->fr_prev = frp->fr_prev; if (frp->fr_prev != NULL) frp->fr_prev->fr_next = frp->fr_child; -- cgit