From 88a08813800ed7ba7c927986421cee437f7f2233 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Fri, 4 Dec 2020 11:41:39 +0000 Subject: 13363 ctfconvert could support more granular ignore for missing debug data Reviewed by: Robert Mustacchi Approved by: Rich Lowe --- usr/src/common/ctf/ctf_impl.h | 1 + usr/src/common/ctf/ctf_util.c | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'usr/src/common/ctf') diff --git a/usr/src/common/ctf/ctf_impl.h b/usr/src/common/ctf/ctf_impl.h index b208cfb486..526e0f068c 100644 --- a/usr/src/common/ctf/ctf_impl.h +++ b/usr/src/common/ctf/ctf_impl.h @@ -312,6 +312,7 @@ extern void *ctf_alloc(size_t); extern void ctf_free(void *, size_t); extern char *ctf_strdup(const char *); +extern void ctf_strfree(char *); extern const char *ctf_strerror(int); extern void ctf_dprintf(const char *, ...); diff --git a/usr/src/common/ctf/ctf_util.c b/usr/src/common/ctf/ctf_util.c index 550195b5e1..f909bbc4af 100644 --- a/usr/src/common/ctf/ctf_util.c +++ b/usr/src/common/ctf/ctf_util.c @@ -148,6 +148,17 @@ ctf_strdup(const char *s1) return (s2); } +/* + * Free a string which was allocated via ctf_alloc() + */ +void +ctf_strfree(char *s) +{ + if (s == NULL) + return; + ctf_free(s, strlen(s) + 1); +} + /* * Store the specified error code into errp if it is non-NULL, and then * return NULL for the benefit of the caller. -- cgit v1.2.3