[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
An auto_ptr bug in readString
From: |
Bostjan Lah |
Subject: |
An auto_ptr bug in readString |
Date: |
Sat, 04 May 2002 12:21:41 -0400 |
Hi.
First thanks for this excellent CGI library. I have been using it
extensively for the past several months.
I recently also started using it with a memory leak detection tool
Valgrind (http://developer.kde.org/~sewardj/) and it kept reporting
unmatched new[] with delete / free (instead of delete []). The problem
function is readString which uses auto_ptr for allocating a char array
of readSize size, i.e.:
auto_ptr<char> temp(new char[readSize]);
auto_ptrs and arrays apparently don't mix so I'm attaching a patch for
CgiUtils.cpp which uses a simple char *temp instead.
Regards,
Bostjan
readString.patch
Description: Text document
- An auto_ptr bug in readString,
Bostjan Lah <=