From 44b2e9be88541c8c7f860e9c536e347cf5b151e4 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:13:11 -0300 Subject: [PATCH] chore(gpio): add missing errdefer --- src/core/bus/gpio.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/bus/gpio.zig b/src/core/bus/gpio.zig index c5d8dce..60a430d 100644 --- a/src/core/bus/gpio.zig +++ b/src/core/bus/gpio.zig @@ -68,6 +68,8 @@ pub const Gpio = struct { log.info("Device: {}", .{kind}); const self = try allocator.create(Self); + errdefer allocator.destroy(self); + self.* = .{ .data = 0b0000, .direction = 0b1111, // TODO: What is GPIO DIrection set to by default?