frr/tools/coccinelle/xmalloc_returnval.cocci
Daniel Baumann 3124f89aed
Adding upstream version 10.1.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-05 10:03:58 +01:00

37 lines
515 B
Text

/// XMALLOC, XCALLOC etc either return non-null, or abort the program.
/// Never nullcheck these.
//
// Copyright: (C) 2019 Quentin Young. GPLv2.
virtual patch
//----------------------------------------------------------
// For patch mode
//----------------------------------------------------------
@depends on patch@
identifier alloc;
@@
alloc = XMALLOC(...);
...
- if (alloc == NULL)
- {
- ...
- }
@depends on patch@
identifier alloc;
@@
alloc = XCALLOC(...);
...
- if (alloc == NULL)
- {
- ...
- }