From: Ondřej Surý Date: Thu, 29 Aug 2019 07:35:37 +0000 (+0200) Subject: isc_event_allocate() can't fail now, add spatch to remove the checks X-Git-Tag: v9.15.4~18^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2d12def6eef8925cafbebbc7e1f09c5d6a7ee196;p=thirdparty%2Fbind9.git isc_event_allocate() can't fail now, add spatch to remove the checks --- diff --git a/cocci/isc_event_allocat_never_fail.spatch b/cocci/isc_event_allocat_never_fail.spatch new file mode 100644 index 00000000000..eab22659f50 --- /dev/null +++ b/cocci/isc_event_allocat_never_fail.spatch @@ -0,0 +1,33 @@ +@@ +statement S; +expression V; +@@ + +V = isc_event_allocate(...); +- if (V == NULL) S + +@@ +type T; +statement S; +expression V; +@@ + +V = (T *)isc_event_allocate(...); +- if (V == NULL) S + +@@ +statement S; +expression V; +@@ + +if (V == NULL) V = isc_event_allocate(...); +- if (V == NULL) S + +@@ +statement S1, S2; +expression V; +@@ + +V = isc_event_allocate(...); +- if (V == NULL) S1 else { S2 } ++ S2