mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
malloc -> calloc
This commit is contained in:
parent
1e9a9f2838
commit
b050ebc2b9
2 changed files with 3 additions and 7 deletions
|
@ -674,15 +674,11 @@ static int CmdHF14AWSLoad(const char *Cmd) {
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gdImageDestroy(pal_img);
|
gdImageDestroy(pal_img);
|
||||||
|
|
||||||
int res = start_drawing(model_nr, black_plane, red_plane);
|
int res = start_drawing(model_nr, black_plane, red_plane);
|
||||||
|
|
||||||
free(black_plane);
|
free(black_plane);
|
||||||
if (red_plane) {
|
free(red_plane);
|
||||||
free(red_plane);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate space for palette in YCbCr
|
// Allocate space for palette in YCbCr
|
||||||
struct ycbcr_t * pal_ycbcr = malloc(palette_size * sizeof(struct ycbcr_t));
|
struct ycbcr_t * pal_ycbcr = calloc(palette_size, sizeof(struct ycbcr_t));
|
||||||
if (!pal_ycbcr) {
|
if (!pal_ycbcr) {
|
||||||
gdImageDestroy(res);
|
gdImageDestroy(res);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue