mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-28 05:54:19 -04:00
Correct some memory leaks found by MSVC
This commit is contained in:
parent
6c631bf282
commit
18b986156f
10 changed files with 60 additions and 35 deletions
|
@ -23,7 +23,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <malloc.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "common.h"
|
||||
#include "aztec.h"
|
||||
|
@ -55,14 +55,14 @@ int aztec_text_process(unsigned char source[], char binary_string[], int gs1)
|
|||
int i, j, k, bytes;
|
||||
int curtable, newtable, lasttable, chartype, maplength, blocks, debug;
|
||||
#ifndef _MSC_VER
|
||||
int charmap[ustrlen(source)], typemap[ustrlen(source)];
|
||||
int charmap[ustrlen(source) * 2], typemap[ustrlen(source) * 2];
|
||||
int blockmap[2][ustrlen(source)];
|
||||
#else
|
||||
int* charmap = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
int* typemap = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
int* charmap = (int*)_alloca((ustrlen(source) * 2) * sizeof(int));
|
||||
int* typemap = (int*)_alloca((ustrlen(source) * 2) * sizeof(int));
|
||||
int* blockmap[2];
|
||||
blockmap[0] = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
blockmap[1] = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
blockmap[0] = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
blockmap[1] = (int*)_alloca(ustrlen(source) * sizeof(int));
|
||||
#endif
|
||||
/* Lookup input string in encoding table */
|
||||
maplength = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue