]> git.proxmox.com Git - pve-cluster.git/commitdiff
use const char * for log_domain
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 8 Feb 2012 08:46:49 +0000 (09:46 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 8 Feb 2012 08:46:49 +0000 (09:46 +0100)
There is no need to alloc/free that string.

data/src/dfsm.c

index 7922a2ec03ed7603a6c1e409b382272f8065122d..0d19fda9f8d0923ac18281f23c1924cc5c6a41ad 100644 (file)
@@ -102,7 +102,7 @@ typedef struct {
 } dfsm_queued_message_t;
 
 struct dfsm {
-       char *log_domain;
+       const char *log_domain;
        cpg_callbacks_t *cpg_callbacks;
        dfsm_callbacks_t *dfsm_callbacks;
        cpg_handle_t cpg_handle;
@@ -1257,7 +1257,7 @@ dfsm_new(
        if (!(dfsm->msg_queue = g_sequence_new(NULL))) 
                goto err;
                
-       dfsm->log_domain = g_strdup(log_domain);
+       dfsm->log_domain = log_domain;
        dfsm->data = data;
        dfsm->mode = DFSM_MODE_START;
        dfsm->protocol_version = protocol_version;
@@ -1530,9 +1530,6 @@ dfsm_destroy(dfsm_t *dfsm)
        if (dfsm->members)
                g_hash_table_destroy(dfsm->members);
 
-       if (dfsm->log_domain)
-               g_free(dfsm->log_domain);
-
        g_free(dfsm);
 }