Ack from me.

Best regards,
Zoran

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: den 15 september 2014 14:23
To: Anders Björnerstedt; Zoran Milinkovic
Cc: [email protected]
Subject: [PATCH 1 of 1] imm:freeing the allocated memory in dumping resources 
at PBE [#1061]

 osaf/services/saf/immsv/immnd/ImmModel.cc        |  17 ++++++++++-------
 osaf/services/saf/immsv/immpbed/immpbe_daemon.cc |  11 +++++++++++
 2 files changed, 21 insertions(+), 7 deletions(-)


Freeing the rparams after sending saImmOiAdminOperationResult to immm for 
Resource display at PBE.
The patch also prints the output of ResourceDisplay to syslog, only if the 
requested resource are greater than 128 for adminowners

diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -11249,7 +11249,8 @@ ImmModel::resourceDisplay(const struct I
                     }
                                         
                 } else {
-                    LOG_NO("The Number of implementers are greater than 128, 
displaying the implementers informati                                           
             on to syslog");                
+                    LOG_NO("The Number of implementers are greater than 128, 
displaying the implementers" 
+                                   "information to syslog");                
                     ImplementerVector::iterator i;
                     for(i = sImplementerVector.begin(); i != 
sImplementerVector.end(); ++i) {
                         ImplementerInfo* info = (*i);
@@ -11281,14 +11282,16 @@ ImmModel::resourceDisplay(const struct I
                             resparams=res;
                         }
                     }
-                }
-                LOG_NO("The Number of AdminOwners are greater than 128, 
displaying the adminowner information                                           
              to syslog");       
-                AdminOwnerVector::iterator i;
-                for(i = sOwnerVector.begin(); i != sOwnerVector.end(); ++i) {
-                    AdminOwnerInfo* adminOwner = (*i);
-                    LOG_IN("Implementer name %s and location of the 
implementer is %u", 
+                } else {
+                    LOG_NO("The Number of AdminOwners are greater than 128, 
displaying the adminowner" 
+                                   "information to syslog");       
+                    AdminOwnerVector::iterator i;
+                    for(i = sOwnerVector.begin(); i != sOwnerVector.end(); 
++i) {
+                        AdminOwnerInfo* adminOwner = (*i);
+                        LOG_IN("Implementer name %s and location of the 
implementer is %u", 
                                     adminOwner->mAdminOwnerName.c_str(), 
adminOwner->mNodeId);    
                     }
+                }
             }
         } else {
             LOG_WA("Verbose display of reourcename %s is unsupported", 
resourceName);
diff --git a/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc 
b/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
--- a/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
+++ b/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
@@ -1133,6 +1133,17 @@ static void saImmOiAdminOperationCallbac
                                LOG_WA("Operation Name is not provided for 
operation ID %llu", (SaUint64T) opId);
                                rc = 
immutil_saImmOiAdminOperationResult(immOiHandle, invocation, 
SA_AIS_ERR_INVALID_PARAM);
                }
+               i=0;
+               while (rparams[i]) {
+                       resparams = rparams[i];
+                       if(resparams->paramName)
+                                       free(resparams->paramName);
+                       if(resparams->paramBuffer) 
+                                       free(resparams->paramBuffer);
+                       free(resparams);
+                       i++;
+               }
+               free(rparams);
        } else {
                LOG_WA("Invalid operation ID %llu", (SaUint64T) opId);
                rc = immutil_saImmOiAdminOperationResult(immOiHandle, 
invocation, SA_AIS_ERR_INVALID_PARAM);

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to