mesa: use util_strdup() macro in symbol_table.c
authorBrian Paul <brianp@vmware.com>
Tue, 17 Oct 2017 19:58:47 +0000 (13:58 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 23 Oct 2017 21:10:32 +0000 (15:10 -0600)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/program/symbol_table.c

index 37066c904cc91c42866c0af45f78732a8f76a8df..f5dacbbf1edfc9b075bdf4e5cd56e2f9a8eea8de 100644 (file)
@@ -24,6 +24,7 @@
 #include "main/imports.h"
 #include "symbol_table.h"
 #include "../../util/hash_table.h"
+#include "util/u_string.h"
 
 struct symbol {
    /** Symbol name. */
@@ -192,7 +193,7 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
       new_sym->next_with_same_name = sym;
       new_sym->name = sym->name;
    } else {
-      new_sym->name = strdup(name);
+      new_sym->name = util_strdup(name);
       if (new_sym->name == NULL) {
          free(new_sym);
          _mesa_error_no_memory(__func__);
@@ -264,7 +265,7 @@ _mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table,
 
       sym->name = inner_sym->name;
    } else {
-      sym->name = strdup(name);
+      sym->name = util_strdup(name);
       if (sym->name == NULL) {
          free(sym);
          _mesa_error_no_memory(__func__);