summaryrefslogtreecommitdiff
path: root/bittorrent/mbtstr/src/dtor.c
diff options
context:
space:
mode:
Diffstat (limited to 'bittorrent/mbtstr/src/dtor.c')
-rw-r--r--bittorrent/mbtstr/src/dtor.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/bittorrent/mbtstr/src/dtor.c b/bittorrent/mbtstr/src/dtor.c
new file mode 100644
index 0000000..af35c9e
--- /dev/null
+++ b/bittorrent/mbtstr/src/dtor.c
@@ -0,0 +1,15 @@
+#include <stdbool.h>
+#include <stdlib.h>
+
+#include "mbtstr/str.h"
+
+void mbt_str_dtor(struct mbt_str *str)
+{
+ if (str->data != NULL)
+ {
+ free(str->data);
+ str->data = NULL;
+ }
+ str->size = 0;
+ str->capacity = 0;
+}