[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

NULL pointers.

From: Mark Grosberg <mark_at_nolab.conman.org>
Date: 2003-09-19 22:57:40 CEST

Hey guys,

I noticed some changes to the trail functions. In particular, in
begin_trail the trail->db_txn pointer is not explicitly set to NULL if no
transaction is to be used. In particular this can cause abort_trail() or
commit_trail() to get confused later on for certain platforms.

In particular, even though the trail structure is allocated with
pcalloc(), ANSI states that all-zero-bits does not equal a NULL pointer.
So, much like the undo pointer, this must be set to NULL manually.

 begin_trail (trail_t **trail_p,
              svn_fs_t *fs,
              int use_txn,
              apr_pool_t *pool)
 {
   trail_t *trail = apr_pcalloc (pool, sizeof (*trail));

   trail->pool = svn_pool_create (pool);
   trail->scratchpool = svn_pool_create (trail->pool);
   trail->undo = 0;
+ trail->db_txn = 0;

Thanks,
Mark G.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 19 22:58:17 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.