None of the three call sites want to keep the value for any length of
time - they just use it right away. Replace the allocation with a use
of the round-robin buffers from ipaddr_getbuf, and remove the frees at
the call sites.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
uint8_t a,b,c,d;
string_t s;
uint8_t a,b,c,d;
string_t s;
- s=safe_malloc(19,"subnet_to_string");
a=addr>>24;
b=addr>>16;
c=addr>>8;
a=addr>>24;
b=addr>>16;
c=addr>>8;
for (i=0; i<snets->entries; i++) {
net=subnet_to_string(snets->list[i]);
Message(loglevel,"%s ",net);
for (i=0; i<snets->entries; i++) {
net=subnet_to_string(snets->list[i]);
Message(loglevel,"%s ",net);
for (i=0; i<st->subnets->entries; i++) {
net=subnet_to_string(st->subnets->list[i]);
Message(c,"%s ",net);
for (i=0; i<st->subnets->entries; i++) {
net=subnet_to_string(st->subnets->list[i]);
Message(c,"%s ",net);
}
if (i>0)
Message(c,"-> host (use %d)\n",st->outcount);
}
if (i>0)
Message(c,"-> host (use %d)\n",st->outcount);
s=subnet_to_string(snets->list[i]);
strcat(nets,s);
strcat(nets,",");
s=subnet_to_string(snets->list[i]);
strcat(nets,s);
strcat(nets,",");
}
nets[strlen(nets)-1]=0;
subnet_list_free(snets);
}
nets[strlen(nets)-1]=0;
subnet_list_free(snets);