commit 522f270eb11a51dfec390a6e1ae204cd35f6f0b0
parent b7b61d6fb3918aee2a49145e0ef8cab1598f80fb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 4 Jan 2017 09:23:11 +0100
Add memory leaks notification
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -15,6 +15,7 @@
#include "solstice.h"
#include "solstice_args.h"
+
#include <rsys/rsys.h>
int
@@ -22,6 +23,7 @@ main(int argc, char** argv)
{
struct solstice_args args;
struct solstice solstice;
+ size_t memsz = 0;
res_T res;
int solstice_is_init = 0;
int err = 0;
@@ -36,6 +38,9 @@ main(int argc, char** argv)
exit:
if(solstice_is_init) solstice_release(&solstice);
solstice_args_release(&args);
+ if((memsz = mem_allocated_size()) != 0) {
+ fprintf(stderr, "Memory leaks: %lu Bytes\n", (unsigned long)memsz);
+ }
return err;
error:
err = -1;