Hi Hieu,

Fix indentation. In C files, we use TAB instead of spaces.
Ack from me.

Thanks,
Zoran

-----Original Message-----
From: Hieu Nguyen [mailto:[email protected]] 
Sent: den 3 april 2017 07:26
To: Zoran Milinkovic <[email protected]>; 
[email protected]; Hung Duc Nguyen <[email protected]>
Cc: [email protected]
Subject: [PATCH 1 of 1] immm: Fixed memory leak in imm_cfg.c file [#2408]

 src/imm/tools/imm_cfg.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


Fixed memory leak in unique_admiOwner() function of imm_cfg.c file

diff --git a/src/imm/tools/imm_cfg.c b/src/imm/tools/imm_cfg.c
--- a/src/imm/tools/imm_cfg.c
+++ b/src/imm/tools/imm_cfg.c
@@ -857,10 +857,14 @@ static char *create_adminOwnerName(char 
 
        if (gethostname(hostname, sizeof(hostname)) != 0){
                fprintf(stderr, "error while retrieving hostname\n");
-               if(transaction_mode)
-                       return NULL;
-               else
+               if(transaction_mode) {
+                    if(unique_adminOwner)
+                        free(unique_adminOwner);
+                    return NULL;
+                }
+               else {
                        exit(EXIT_FAILURE);
+                }
        }
        sprintf(unique_adminOwner, "%s_%s_%d", base, hostname, getpid());
        return unique_adminOwner;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to