memleak --

This commit is contained in:
taipanromania 2008-09-27 21:15:38 +00:00
parent 5ec2e85467
commit 3bb2c46210
2 changed files with 5 additions and 3 deletions

View File

@ -403,6 +403,7 @@ int maxi_png_plot(struct zint_symbol *symbol, int rotate_angle)
} }
png_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle); png_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle);
free(pixelbuf);
} }
int png_plot(struct zint_symbol *symbol, int rotate_angle) int png_plot(struct zint_symbol *symbol, int rotate_angle)
@ -788,6 +789,7 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle)
} }
png_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle); png_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle);
free(pixelbuf);
} }
int png_handle(struct zint_symbol *symbol, int rotate_angle) int png_handle(struct zint_symbol *symbol, int rotate_angle)

View File

@ -300,6 +300,7 @@ int main(int argc, char **argv)
error_number = data_process(my_symbol, optarg, rotate_angle); error_number = data_process(my_symbol, optarg, rotate_angle);
if(error_number != 0) { if(error_number != 0) {
printf("%s\n", my_symbol->errtxt); printf("%s\n", my_symbol->errtxt);
ZBarcode_Delete(my_symbol);
return 1; return 1;
} }
break; break;
@ -332,7 +333,6 @@ int main(int argc, char **argv)
printf(my_symbol->errtxt); printf(my_symbol->errtxt);
printf("\n"); printf("\n");
} }
ZBarcode_Delete(my_symbol); ZBarcode_Delete(my_symbol);
return error_number; return error_number;