systemd/coccinelle/safe_fclose.cocci

29 lines
366 B
Plaintext
Raw Normal View History

2023-04-12 17:00:04 +08:00
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2022-05-14 02:56:24 +08:00
@@
expression p;
@@
- if (p) {
- fclose(p);
- p = NULL;
- }
+ p = safe_fclose(p);
@@
expression p;
@@
- if (p)
- fclose(p);
- p = NULL;
+ p = safe_fclose(p);
@@
expression p;
@@
- fclose(p);
- p = NULL;
+ p = safe_fclose(p);
@@
expression p;
@@
- if (p)
- fclose(p);
+ safe_fclose(p);