Fix the strdup-of-OverlapErr-string problem better. Move the
strdup to MAC_(record_overlap_error), wherein we know that
s is a string.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1786 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_errcontext.c b/coregrind/vg_errcontext.c
index ca5b7f7..19f86ff 100644
--- a/coregrind/vg_errcontext.c
+++ b/coregrind/vg_errcontext.c
@@ -185,12 +185,8 @@
err->ekind = ekind;
err->addr = a;
err->extra = extra;
- if (s) {
- err->string = VG_(arena_strdup)( VG_AR_ERRORS, s );
- }
- else {
- err->string = NULL;
- }
+ err->string = s;
+
/* sanity... */
vg_assert( tid < VG_N_THREADS );
}
@@ -345,7 +341,6 @@
}
/* Build ourselves the error */
- err.string = NULL;
construct_error ( &err, tid, ekind, a, s, extra, NULL );
/* First, see if we've got an error record matching this one. */
@@ -372,12 +367,6 @@
vg_errors = p;
}
- /* Free err.string, if we allocated it. */
- if (err.string) {
- VG_(arena_free)( VG_AR_ERRORS, err.string );
- err.string = NULL; /* paranoia */
- }
-
return;
}
p_prev = p;