subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fuhrmann <stefan.fuhrm...@wandisco.com>
Subject Re: svn commit: r1663450 - /subversion/trunk/subversion/libsvn_ra_svn/editorp.c
Date Tue, 03 Mar 2015 15:28:38 GMT
On Tue, Mar 3, 2015 at 12:17 PM, Julian Foad <julianfoad@btopenworld.com>
wrote:

> >>> URL: http://svn.apache.org/r1663450
>
> >>> Log:
> >>> Following up on r1658194, fix removing tokens from the tokens cache.
> >>> Just passing the token to svn_hash_sets() didn't work any more.
>

My bad.

Talked about the leak on IRC last night. Bert then bet me on finding
the source and fixing it.


> Thinking about how to prevent a repeat of the same kind of error, defining
> svn_hash_sets and svn_hash_gets as functions with prototypes would result
> in at least a compiler warning (for typical configurations).
>

>From r1484181 to r1509166, we already had various more sophisticated
definitions for those macros. Some of them would have caught the type
mismatch. I think it would be safe to change them into something like this:

#define svn_hash_sets(ht, key, val)                               \
  do {                                                            \
    const char *svn_key__temp = (key);                            \
    apr_hash_set(ht, svn_key__temp, strlen(svn_key__temp), val);  \
  } while (0)

-- Stefan^2.

Mime
View raw message