Skip to content

Commit d216391

Browse files
committed
Libc (BSD): always initialize variables
1 parent 743babd commit d216391

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/detection/libc/libc_bsd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
const char* ffDetectLibc(FFLibcResult* result)
44
{
5+
result->name = "Unknown";
6+
result->version = NULL;
7+
58
#ifdef __DragonFly__ // We define `__FreeBSD__` on DragonFly BSD for simplification
69
result->name = "DF";
710
#ifdef FF_DF_VERSION
@@ -12,9 +15,7 @@ const char* ffDetectLibc(FFLibcResult* result)
1215
#ifdef FF_FBSD_VERSION
1316
result->version = FF_FBSD_VERSION;
1417
#endif
15-
#else
16-
result->name = "Unknown";
17-
result->version = NULL;
1818
#endif
19+
1920
return NULL;
2021
}

0 commit comments

Comments
 (0)