]> andersk Git - moira.git/commitdiff
thou shalt not free memory thou did not malloc
authorjweiss <jweiss>
Tue, 12 Sep 1995 23:20:18 +0000 (23:20 +0000)
committerjweiss <jweiss>
Tue, 12 Sep 1995 23:20:18 +0000 (23:20 +0000)
clients/moira/cluster.c

index e2e4273bd1c067bc6c23f8379a61ce2ff55c483c..bdc14a4966f0563ff1ee66c106a5d13f34ec83ef 100644 (file)
@@ -547,13 +547,26 @@ Bool name;
          * The SetMachinedefaults() has been changed to reflect this.
          * pray for us and may we attain enlightenment through structures.  
          */
+
+
+       if(name) {
+           /* info did not come from SetMachineDefaults(), which does not
+            * initialize entry 8 (M_STAT_CHNG), therefore we can
+            * free it.
+            */
+           /* This is an update of an existing machine and the structure
+            * was filled in thru a query to the db which does fill in this
+            * field.
+            */
            free(info[8]);
-            info[8] = info[M_SUBNET];
-           info[9] = info[M_ADDR];
-           info[10] = info[M_OWNER_TYPE];
-           info[11] = info[M_OWNER_NAME];
-           info[12] = info[M_ACOMMENT];
-           info[13] = info[M_OCOMMENT];
+       }
+       
+       info[8] = info[M_SUBNET];
+       info[9] = info[M_ADDR];
+       info[10] = info[M_OWNER_TYPE];
+       info[11] = info[M_OWNER_NAME];
+       info[12] = info[M_ACOMMENT];
+       info[13] = info[M_OCOMMENT];
 
         if(name)
           if (GetValueFromUser("Machine's network (or 'none')", &info[8])
This page took 0.045288 seconds and 5 git commands to generate.