Florian Forster ha scritto:
> Hi Marco,
Hi Florian,
> I'm too tired to have a look at this now, I hope to have some time in
> the next few days. I'll come back to you asap.
That's fine :)
But sorry, I forgot to recheck a small part of the code after adding and
moving some stuff around, please apply this patch too.
Regards,
Marco
{
WARNING ("status filename \"%s\" already used, \
please choose a different one.", status_name);
{
WARNING ("status filename \"%s\" already used, \
please choose a different one.", status_name);
- /* create a new vpn element since file and version are ok */
+ /* create a new vpn element since file, version and name are ok */
temp = (vpn_status_t *) malloc (sizeof (vpn_status_t));
temp->file = status_file;
temp->version = status_version;
temp = (vpn_status_t *) malloc (sizeof (vpn_status_t));
temp->file = status_file;
temp->version = status_version;
vpn_list = (vpn_status_t **) realloc (vpn_list, (vpn_num + 1) * sizeof (vpn_status_t *));
if (vpn_list == NULL)
{
vpn_list = (vpn_status_t **) realloc (vpn_list, (vpn_num + 1) * sizeof (vpn_status_t *));
if (vpn_list == NULL)
{
- char errbuf[1024];
- ERROR ("openvpn plugin: malloc failed: %s",
- sstrerror (errno, errbuf, sizeof (errbuf)));
- return (1);
+ char errbuf[1024];
+ ERROR ("openvpn plugin: malloc failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+
+ sfree (temp->file);
+ sfree (temp);
+ return (1);
}
vpn_list[vpn_num] = temp;
}
vpn_list[vpn_num] = temp;