From 26dba16789d54d7cae182c0ab9eec4e39a2b63ee Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 17 Oct 2022 20:01:50 -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?