summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/diff.c b/src/diff.c
index 41cfefe5e..ec8c8f175 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -559,14 +559,14 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
diff_T *dnew;
dnew = ALLOC_ONE(diff_T);
- if (dnew != NULL)
- {
- dnew->df_next = dp;
- if (dprev == NULL)
- tp->tp_first_diff = dnew;
- else
- dprev->df_next = dnew;
- }
+ if (dnew == NULL)
+ return NULL;
+
+ dnew->df_next = dp;
+ if (dprev == NULL)
+ tp->tp_first_diff = dnew;
+ else
+ dprev->df_next = dnew;
return dnew;
}