memory bug corrected

This commit is contained in:
cvs
2000-04-07 14:24:01 +00:00
parent 9c9a2d45a5
commit c70f0b7cb8
12 changed files with 45 additions and 25 deletions

View File

@@ -158,8 +158,8 @@ void str_put_start(Str_Buf *buf)
Str_Buf *str_create_buf(size_t size, char separator)
{ Str_Buf *buf;
ERR_P(buf=malloc(sizeof(*buf)));
ERR_P(buf->buf=malloc(size));
NEW(buf);
ERR_P(buf->buf=my_malloc(size, "buf"));
buf->dsize=size;
buf->sep=separator;
buf->wrpos=0;
@@ -183,6 +183,6 @@ void str_link_buf(Str_Buf *buf, char *str, int size, char separator) {
}
void str_free_buf(Str_Buf *buf)
{ free(buf->buf);
free(buf);
{ my_free(buf->buf);
my_free(buf);
}