Changeset 60 in openpam


Ignore:
Timestamp:
Feb 13, 2002, 1:21:37 PM (17 years ago)
Author:
Dag-Erling Smørgrav
Message:

Log allocation failures.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_getenvlist.c

    r16 r60  
    4141
    4242#include "openpam_impl.h"
     43
    4344/*
    4445 * XSSO 4.2.1
     
    5758                return (NULL);
    5859
    59         if ((envlist = malloc(sizeof(char *) * (pamh->env_count + 1))) == NULL)
     60        envlist = malloc(sizeof(char *) * (pamh->env_count + 1));
     61        if (envlist == NULL) {
     62                openpam_log(PAM_LOG_ERROR, "%s",
     63                        pam_strerror(pamh, PAM_BUF_ERR));
    6064                return (NULL);
     65        }
    6166        for (i = 0; i < pamh->env_count; ++i) {
    6267                if ((envlist[i] = strdup(pamh->env[i])) == NULL) {
     
    6469                                free(envlist[--i]);
    6570                        free(envlist);
     71                        openpam_log(PAM_LOG_ERROR, "%s",
     72                                pam_strerror(pamh, PAM_BUF_ERR));
    6673                        return (NULL);
    6774                }
Note: See TracChangeset for help on using the changeset viewer.