Changeset 805b06c in git


Ignore:
Timestamp:
Nov 5, 1998, 6:52:53 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c7af8613769b29c741d6c338945669719f1fc4f8')
Children:
05392573ce02d1b7ca67f967aa3457296919306d
Parents:
3469f17f686247fd41d09428b55208f4c836ef03
Message:
*hannes: fixed memory leaks


git-svn-id: file:///usr/local/Singular/svn/trunk@2644 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipassign.cc

    r3469f1 r805b06c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.40 1998-10-29 13:27:54 Singular Exp $ */
     4/* $Id: ipassign.cc,v 1.41 1998-11-05 17:52:50 Singular Exp $ */
    55
    66/*
     
    316316  pNormalize(MATELEM(am,1,1));
    317317  MATELEM(m,i,j)=MATELEM(am,1,1);
     318  MATELEM(am,1,1)=NULL;
     319  idDelete((ideal *)&am);
    318320  return FALSE;
    319321}
  • Singular/ipconv.cc

    r3469f1 r805b06c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.13 1998-11-04 18:28:02 Singular Exp $ */
     4/* $Id: ipconv.cc,v 1.14 1998-11-05 17:52:52 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    150150    pSetCoeff(p,(number)data);
    151151  }
    152   else
    153   {
    154     nDelete((number *)&data);
    155  
     152  //else
     153  //{
     154  //  nDelete((number *)&data);
     155  //
    156156  return (void *)p;
    157157}
     
    166166    I->m[0]=p;
    167167  }
    168   else
    169   {
    170     nDelete((number *)&data);
    171  
     168  //else
     169  //{
     170  //  nDelete((number *)&data);
     171  //
    172172  return (void *)I;
    173173}
  • Singular/iplib.cc

    r3469f1 r805b06c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.39 1998-10-29 13:27:56 Singular Exp $ */
     4/* $Id: iplib.cc,v 1.40 1998-11-05 17:52:53 Singular Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    355355  idhdl ns = namespaceroot->get(plib,0, TRUE);
    356356  if((ns==NULL) && (slpn!=NULL) && (slpn->packhdl != NULL)) ns=slpn->packhdl;
    357   if(pi->is_static) {
    358     if(ns==NULL) {
     357  if(pi->is_static)
     358  {
     359    if(ns==NULL)
     360    {
    359361      Werror("'%s::%s()' 1 is a local procedure and cannot be accessed by an user.",
    360362             plib, pi->procname);
     
    362364      return NULL;
    363365    }
    364     if(strcmp(plib, namespaceroot->name)!= 0) {
     366    if(strcmp(plib, namespaceroot->name)!= 0)
     367    {
    365368      Werror("'%s::%s()' 2 is a local procedure and cannot be accessed by an user.",
    366369             plib, pi->procname);
     
    369372    }
    370373  }
    371   FreeL(plib);
     374  FreeL((ADDRESS)plib);
    372375  if(ns != NULL)
    373376  {
     
    385388    Werror("'%s::%s()' is a local procedure and cannot be accessed by an user.",
    386389           pi->libname, pi->procname);
     390    FreeL((ADDRESS)plib);
    387391    return NULL;
    388392  }
    389393  namespaceroot->push(NULL, plib, myynest+1);
     394  FreeL((ADDRESS)plib);
    390395#endif /* HAVE_NAMESPACES */
    391396  iiCheckNest();
     
    508513  BOOLEAN err;
    509514  int old_echo=si_echo;
     515#ifdef HAVE_NAMESPACES
    510516  char *plib = iiConvName(pi->libname);
    511 #ifdef HAVE_NAMESPACES
    512517  idhdl ns = namespaceroot->get(plib,0, TRUE);
     518  FreeL((ADDRESS)plib);
    513519#endif /* HAVE_NAMESPACES */
    514520
     
    599605  int token;
    600606
    601   if(IsCmd(plib, &token)) {
     607  if(IsCmd(plib, &token))
     608  {
    602609    Werror("'%s' is resered identifier\n", plib);
    603610    return TRUE;
     
    645652      }
    646653      if (f)
    647         FreeL(s);
     654        FreeL((ADDRESS)s);
    648655      else
    649656      {
     
    675682    IDPACKAGE(pl)->language = LANG_SINGULAR;
    676683    IDPACKAGE(pl)->libname=mstrdup(newlib);
    677   } else {
    678     if(IDTYP(pl)!=PACKAGE_CMD) {
     684  }
     685  else
     686  {
     687    if(IDTYP(pl)!=PACKAGE_CMD)
     688    {
    679689      Warn("not of typ package.");
    680690      return TRUE;
     
    700710  yylplex(newlib, libnamebuf, &lib_style);
    701711# endif /* HAVE_NAMESPACES */
    702   if(yylp_errno) {
     712  if(yylp_errno)
     713  {
    703714    Werror("Library %s: ERROR occured: in line %d, %d.", newlib, yylplineno,
    704715         current_pos(0));
    705     if(yylp_errno==YYLP_BAD_CHAR) {
     716    if(yylp_errno==YYLP_BAD_CHAR)
     717    {
    706718      Werror(yylp_errlist[yylp_errno], *text_buffer, yylplineno);
    707       FreeL(text_buffer);
    708     } else
     719      FreeL((ADDRESS)text_buffer);
     720    }
     721    else
    709722      Werror(yylp_errlist[yylp_errno], yylplineno);
    710723    Werror("Cannot load library,... aborting.");
     
    712725    fclose( yylpin );
    713726    FreeL((ADDRESS)newlib);
     727# ifdef HAVE_NAMESPACES
     728    FreeL((ADDRESS)plib);
     729# endif /* HAVE_NAMESPACES */
    714730    return TRUE;
    715731  }
    716732  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded %s %s\n", libnamebuf,
    717733                                   text_buffer);
    718   if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB))) {
     734  if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB)))
     735  {
    719736    Warn( "library %s has old format. This format is still accepted,", newlib);
    720737    Warn( "but for functionality you may wish to change to the new");
     
    724741  fclose( yylpin );
    725742#ifdef HAVE_NAMESPACES
    726    namespaceroot->pop();
     743  namespaceroot->pop();
    727744#endif /* HAVE_NAMESPACES */
    728745  {
    729746    libstackv ls;
    730     for(ls = library_stack; (ls != NULL) && (ls != ls_start); ) {
    731       if(ls->to_be_done) {
     747    for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
     748    {
     749      if(ls->to_be_done)
     750      {
    732751        //Print("// Processing id %d LIB:%s\n", ls->cnt, ls->get());
    733752        ls->to_be_done=FALSE;
     
    829848#endif /* HAVE_NAMESPACES */
    830849            FreeL((ADDRESS)p);
    831           } else
     850          }
     851          else
    832852#endif
    833853#ifdef HAVE_NAMESPACES
     
    925945  if( strcmp(procname,"_init")==0)
    926946  {
    927     char *p = iiConvName(libname);
    928     pi->procname = mstrdup(p);
    929     FreeL((ADDRESS)p);
    930   } else pi->procname = mstrdup(procname);
     947    pi->procname = iiConvName(libname);
     948  }
     949  else
     950    pi->procname = mstrdup(procname);
    931951  pi->language = LANG_SINGULAR;
    932952  pi->ref = 1;
     
    10031023  *r = mytoupper(*r);
    10041024  // printf("iiConvName: '%s' '%s' => '%s'\n", libname, tmpname, r);
    1005   FreeL(tmpname);
     1025  FreeL((ADDRESS)tmpname);
    10061026
    10071027  return(r);
     
    10361056        sprintf(name, "%s -> %s", IDID(h), proc->procname);
    10371057        Print( "%d %-15s  %20s ", proc->is_static ? 1 : 0, proc->libname, name);
    1038         FreeL(name);
     1058        FreeL((ADDRESS)name);
    10391059      }
    10401060      else
     
    10981118{
    10991119  libstackv ls = this;
    1100   //FreeL(ls->libname);
     1120  //FreeL((ADDRESS)ls->libname);
    11011121  library_stack = ls->next;
    11021122  Free((ADDRESS)ls, sizeof(libstack));
Note: See TracChangeset for help on using the changeset viewer.