aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-04-27 21:45:25 -0400
committerSam Anthony <sam@samanthony.xyz>2025-04-27 21:45:25 -0400
commit40742d7d31a8c51f416b52a2a203c312bca8795e (patch)
treeb01457146525bd9cb17be331697e7c3798b70927 /util.c
parent3421dfc10b2fbb00a3cea97619d7d0feccd79965 (diff)
downloadvolute-40742d7d31a8c51f416b52a2a203c312bca8795e.zip
move free_arr() into util.c
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.c b/util.c
new file mode 100644
index 0000000..436a304
--- /dev/null
+++ b/util.c
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+
+#include "util.h"
+
+void
+free_arr(void **arr, int n) {
+ while (n-- > 0) {
+ free(arr[n]);
+ }
+ free(arr);
+}