Replaced some large local variables by other means which save stack space

This commit is contained in:
Thomas Schmitt 2011-05-02 09:16:27 +00:00
parent 4926c98dd4
commit 54878a538e
2 changed files with 13 additions and 4 deletions

View File

@ -100,11 +100,16 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
{
int i, ret;
struct XorrisO *m;
char leafname[SfileadrL];
char *leafname= NULL;
*xorriso= m= TSOB_FELD(struct XorrisO,1);
if(m==NULL)
leafname= TSOB_FELD(char, SfileadrL);
if(leafname == NULL)
return(-1);
*xorriso= m= TSOB_FELD(struct XorrisO,1);
if(m==NULL) {
free(leafname);
return(-1);
}
m->libs_are_started= 0;
strncpy(m->progname,progname,sizeof(m->progname)-1);
m->progname[sizeof(m->progname)-1]= 0;
@ -405,9 +410,13 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
goto failure;
Xorriso_preparer_string(m, m->preparer_id, 1); /* avoids library calls */
if(leafname != NULL)
free(leafname);
return(1);
failure:;
Xorriso_destroy(xorriso, 0);
if(leafname != NULL)
free(leafname);
return(-1);
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.05.02.090908"
#define Xorriso_timestamP "2011.05.02.091632"