Skip to Content.
Sympa Menu

freetds - Memory patches for src/tds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Mark Schaal <mark AT champ.tstonramp.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Memory patches for src/tds
  • Date: Fri, 6 Aug 1999 14:11:10 -0700 (PDT)



I'm not really sure how to make a patch file, so I hope this is right.

These are minor changes to tds_free_socket() and tds_free_msg() so
they will work with null arguments, consistent with the rest of the
tds_free_* fuctions. Of course one could argue for "assert(ptr!=NULL);"
type statements in all these to keep developers on their toes.


*** mem.c Fri Aug 6 13:06:12 1999
--- mem.c~ Fri Aug 6 13:32:48 1999
***************
*** 157,172 ****
}
void tds_free_socket(TDSSOCKET *tds)
{
- if (tds) {
if (tds->msg_info) free(tds->msg_info);
if (tds->in_buf) free(tds->in_buf);
if (tds->out_buf) free(tds->out_buf);
! free(tds);
! }
}
void tds_free_msg(TDSMSGINFO *msg_info)
{
- if (msg_info) {
if(msg_info->message)
free(msg_info->message);
if(msg_info->server)
--- 157,169 ----
}
void tds_free_socket(TDSSOCKET *tds)
{
if (tds->msg_info) free(tds->msg_info);
if (tds->in_buf) free(tds->in_buf);
if (tds->out_buf) free(tds->out_buf);
! if (tds) free(tds);
}
void tds_free_msg(TDSMSGINFO *msg_info)
{
if(msg_info->message)
free(msg_info->message);
if(msg_info->server)
***************
*** 175,179 ****
free(msg_info->proc_name);
if(msg_info->sql_state)
free(msg_info->sql_state);
- }
}
--- 172,175 ----




Mark
--
Mark J. Schaal Phone: (909) 620-7724
TST On Ramp Fax: (909) 620-8174
System Administrator E-Mail: mark AT tstonramp.com



  • Memory patches for src/tds, Mark Schaal, 08/06/1999

Archive powered by MHonArc 2.6.24.

Top of Page