@@ -2237,18 +2237,24 @@ divzero:;
22372237 }
22382238 if ( ( proper1 = PutExtraSymbols (BHEAD arg1 ,startebuf ,& actionflag1 ) ) == 0 ) goto CalledFrom ;
22392239 if ( ( proper2 = PutExtraSymbols (BHEAD arg2 ,startebuf ,& actionflag2 ) ) == 0 ) goto CalledFrom ;
2240+ /*
22402241 if ( type2 == 0 ) M_free(arg2,"DIVfunction");
22412242 else {
22422243 DOLLARS d = ((DOLLARS)arg2)-1;
22432244 if ( d->factors ) M_free(d->factors,"Dollar factors");
22442245 M_free(d,"Copy of dollar variable");
22452246 }
2247+ */
2248+ M_free (arg2 ,"DIVfunction" );
2249+ /*
22462250 if ( type1 == 0 ) M_free(arg1,"DIVfunction");
22472251 else {
22482252 DOLLARS d = ((DOLLARS)arg1)-1;
22492253 if ( d->factors ) M_free(d->factors,"Dollar factors");
22502254 M_free(d,"Copy of dollar variable");
22512255 }
2256+ */
2257+ M_free (arg1 ,"DIVfunction" );
22522258 if ( par == 0 ) proper3 = poly_div (BHEAD proper1 , proper2 );
22532259 else if ( par == 1 ) proper3 = poly_rem (BHEAD proper1 , proper2 );
22542260 else if ( par == 2 ) proper3 = poly_inverse (BHEAD proper1 , proper2 );
@@ -2300,7 +2306,7 @@ divzero:;
23002306}
23012307
23022308/*
2303- #] DIVfunction :
2309+ #] DIVfunction :
23042310 #[ ConvertArgument :
23052311
23062312 Converts an argument to a general notation in allocated space.
@@ -2332,7 +2338,7 @@ WORD *ConvertArgument(PHEAD WORD *arg, int *type)
23322338*/
23332339 output = (WORD * )Malloc1 ((d -> size + 1 )* sizeof (WORD ),"Copy of dollar content" );
23342340 WCOPY (output ,d -> where ,d -> size + 1 );
2335- if ( d -> factors ) M_free (d -> factors ,"Dollar factors" );
2341+ if ( d -> factors ) { M_free (d -> factors ,"Dollar factors" ); d -> factors = 0 ; }
23362342 M_free (d ,"Copy of dollar variable" );
23372343 return (output );
23382344 }
0 commit comments