aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/code-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpg/libqr/code-common.c')
-rw-r--r--lpg/libqr/code-common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lpg/libqr/code-common.c b/lpg/libqr/code-common.c
index 25c1115..32f6492 100644
--- a/lpg/libqr/code-common.c
+++ b/lpg/libqr/code-common.c
@@ -2,11 +2,14 @@
#include <qr/code.h>
#include "code-common.h"
+#include "qr-bitmap.h"
void qr_code_destroy(struct qr_code * code)
{
- free(code->modules);
- free(code);
+ if (code) {
+ qr_bitmap_destroy(code->modules);
+ free(code);
+ }
}
int qr_code_width(const struct qr_code * code)