Skip to content

Commit

Permalink
[network] Fix potential memory leak. Fixes: CID#1311255, CID#1311254,…
Browse files Browse the repository at this point in the history
… CID#1311253, CID#1311252

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jul 7, 2015
1 parent 244191d commit 116b5dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/usb_moded-network.c
Expand Up @@ -337,6 +337,10 @@ static int write_udhcpd_conf(struct ipforward_data *ipforward, struct mode_list_
return(1);
}

interface = get_interface(data);
if(interface == NULL)
return(1);

/* generate start and end ip based on the setting */
ip = get_network_ip();
if(ip == NULL)
Expand Down Expand Up @@ -365,9 +369,6 @@ static int write_udhcpd_conf(struct ipforward_data *ipforward, struct mode_list_
strcat(ipstart,"1");
strcat(ipend, "10");

interface = get_interface(data);
if(interface == NULL)
return(1);
/* print all data in the file */
fprintf(conffile, "start\t%s\n", ipstart);
fprintf(conffile, "end\t%s\n", ipend);
Expand Down

0 comments on commit 116b5dc

Please sign in to comment.