From: jweiss Date: Tue, 12 Sep 1995 23:20:18 +0000 (+0000) Subject: thou shalt not free memory thou did not malloc X-Git-Tag: OPSSRC_BASE~14 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/4bae4be18847e3ce2810484ee671b50f071a2562 thou shalt not free memory thou did not malloc --- diff --git a/clients/moira/cluster.c b/clients/moira/cluster.c index e2e4273b..bdc14a49 100644 --- a/clients/moira/cluster.c +++ b/clients/moira/cluster.c @@ -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])