Skip to content

Commit 4657697

Browse files
committed
confd: wireguard: Add check for null pointer
1 parent ca150a0 commit 4657697

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/confd/src/if-wireguard.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ int wireguard_gen(struct lyd_node *dif, struct lyd_node *cif, FILE *ip, struct d
150150

151151
/* Create activation script */
152152
wg_sh = dagger_fopen_net_init(net, ifname, NETDAG_INIT_POST, "enable-wireguard.sh");
153+
if (!wg_sh)
154+
return SR_ERR_INTERNAL;
153155

154156
fprintf(wg_sh, "wg setconf %s ", ifname);
155157
fprintf(wg_sh, WIREGUARD_CONFIG, ifname);

0 commit comments

Comments
 (0)