summaryrefslogtreecommitdiff
path: root/core/state.c
diff options
context:
space:
mode:
authorIan Moffett <ian@mirocom.org>2026-05-23 06:03:23 -0400
committerIan Moffett <ian@mirocom.org>2026-05-23 06:04:40 -0400
commitf99c1d678f3310a3679b24e518355fbb00211273 (patch)
tree8ec6498d4c591fd2776e203296232d73740200f3 /core/state.c
parent32635789dca1c35224ce6e320a03db23e56d380f (diff)
core: Add pointer box / RAII impl
Signed-off-by: Ian Moffett <ian@mirocom.org>
Diffstat (limited to 'core/state.c')
-rw-r--r--core/state.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/state.c b/core/state.c
index dce1316..6002957 100644
--- a/core/state.c
+++ b/core/state.c
@@ -33,6 +33,11 @@ state_init(struct cescal_state *state, const char *pathname)
return -1;
}
+ if (ptrbox_init(&state->ptrbox) < 0) {
+ close(state->in_fd);
+ return -1;
+ }
+
return 0;
}
@@ -41,4 +46,5 @@ state_close(struct cescal_state *state)
{
close(state->in_fd);
state->in_fd = -1;
+ ptrbox_destroy(&state->ptrbox);
}