Revision 692 branches/merge-trunk-davef/src/tools99/string1.cpp

string1.cpp (revision 692)
7 7
#include <fvar.hpp>
8 8
#include <string.h>
9 9
#include <stdlib.h>
10
#include <safe_mem.h>
11 10
#include "admb_messages.h"
12 11

  
13 12
adstring adstring::operator()(int i, int j)
......
62 61
  {
63 62
    int sz = t.size ();
64 63
    shape->size() = t.size();
65
    mem_free(++s);
64
    free(++s);
66 65
  #if (defined __ZTC__) || (defined __NDPX__)
67
    s =  (char*)mem_malloc(sz+1);
66
    s =  (char*)malloc(sz+1);
68 67
  #else
69
    s =  (unsigned char*)mem_malloc(sz+1);
68
    s =  (unsigned char*)malloc(sz+1);
70 69
  #endif
71 70
    s--;
72 71
    int size = t.size();
......
90 89
{
91 90
  int sz = strlen(t);
92 91
  shape->size() = strlen(t);
93
  mem_free(++s);
94
  s =  (unsigned char*)mem_malloc(sz+1);
92
  free(++s);
93
  s =  (unsigned char*)malloc(sz+1);
95 94
  strcpy((char*)(s),t);
96 95
  s--;
97 96
  adstring * tmp = (adstring *) this->next;
......
107 106
{
108 107
  if (next==this)
109 108
  {
110
    mem_free(shape);
111
    mem_free(++s);
109
    free(shape);
110
    shape=0;
112 111
  }
113 112
};
114 113
 

Also available in: Unified diff