From 5aa878d28918a77ce46d11bd03a5e0353f75dc44 Mon Sep 17 00:00:00 2001 From: smayzy Date: Sat, 11 Apr 2026 16:49:46 +0200 Subject: [PATCH] close soc if ioctl fails --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index ab27cb0..5befb16 100644 --- a/src/main.c +++ b/src/main.c @@ -395,6 +395,7 @@ int main(int argc, char **argv) { strcpy(ifr.ifr_name, "can0"); if (ioctl(soc, SIOCGIFINDEX, &ifr) < 0) { perror("ioctl error"); + close(soc); return 1; } addr.can_family = AF_CAN;