Changeset: 9f0d381a5a54 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9f0d381a5a54
Modified Files:
gdk/gdk_system.c
Branch: Dec2023
Log Message:
No need to malloc/free.
diffs (24 lines):
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -697,15 +697,13 @@ thread_starter(void *arg)
#ifdef HAVE_PTHREAD_H
#ifdef HAVE_PTHREAD_SETNAME_NP
/* name can be at most 16 chars including \0 */
- char *name = GDKstrndup(self->threadname, 15);
- if (name != NULL) {
- pthread_setname_np(
+ char name[16];
+ (void) strcpy_len(name, self->threadname, sizeof(name));
+ pthread_setname_np(
#ifndef __APPLE__
- pthread_self(),
+ pthread_self(),
#endif
- name);
- GDKfree(name);
- }
+ name);
#endif
#else
#ifdef HAVE_SETTHREADDESCRIPTION
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]