X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=4b3e93ed1fbdc93c07d2847e58e230d837619c89;hb=039c51dcdb046fe1d21f101196e6e3e4a851b38c;hp=42e39b8ea96c53950c71c69218d5a5803f2749c4;hpb=797cdae57c27ed74a5ec3b4675f31f2c6cfc98ae;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 42e39b8..4b3e93e 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -1842,6 +1842,10 @@ user_setenv(char **argv) /* The name never changes, so allocate it with the structure */ if (uep == NULL) { uep = malloc(sizeof (*uep) + (eqp-arg)); + if (uep == NULL) { + novm("environment variable"); + return 1; + } strncpy(uep->ue_name, arg, eqp-arg); uep->ue_name[eqp-arg] = '\0'; uep->ue_next = NULL; @@ -1911,6 +1915,10 @@ user_unsetenv(char **argv) /* The name never changes, so allocate it with the structure */ if (uep == NULL) { uep = malloc(sizeof (*uep) + strlen(arg)); + if (uep == NULL) { + novm("environment variable"); + return 1; + } strcpy(uep->ue_name, arg); uep->ue_next = NULL; insp = &userenv_list;