Replaced some large local variables by other means in

This commit is contained in:
2011-05-09 15:49:47 +00:00
parent cc30f4043b
commit 31300231df
4 changed files with 166 additions and 80 deletions

View File

@@ -404,7 +404,11 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
int ret, fifo_chunks, lba, nwa, i, new_img, early_indev_release;
uint32_t data_start= -1;
size_t buffer_size= 0, buffer_free= 0;
char msg[160];
char *msg= NULL;
msg= calloc(1, 160);
if(msg == NULL)
{ret= -1; goto ex;}
new_img= flag&1;
early_indev_release= flag&2;
@@ -608,6 +612,8 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
ex:
if(wopts!=NULL)
{iso_write_opts_free(wopts); wopts= NULL;}
if(msg != NULL)
free(msg);
return ret;
}
@@ -1086,13 +1092,17 @@ int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o,
{
int ret;
IsoWriteOpts *opts = NULL;
char msg[160];
char *msg= NULL;
msg= calloc(1, 160);
if(msg == NULL)
{ret= -1; goto ex;}
ret= iso_write_opts_new(&opts, 0);
if(ret < 0) {
isoburn_msgs_submit(NULL, 0x00060000,
"Cannot create libisofs write options object", 0, "FATAL", 0);
return(0);
{ret= 0; goto ex;}
}
ret= iso_write_opts_set_untranslated_name_len(opts, len);
if(ret < 0) {
@@ -1102,11 +1112,15 @@ int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o,
len, ret);
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
iso_write_opts_free(opts);
return(0);
{ret= 0; goto ex;}
}
o->untranslated_name_len= ret; /* Normalized len value */
iso_write_opts_free(opts);
return(1);
ret= 1;
ex:;
if(msg != NULL)
free(msg);
return(ret);
}