Changeset 99 in openpam


Ignore:
Timestamp:
Apr 2, 2002, 10:47:12 PM (16 years ago)
Author:
Dag-Erling Smørgrav
Message:

Allocate the correct amount of memory for the environment list
(forgot to multiply by sizeof(char *)).

Submitted by: Takanori Saneto <sanewo@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_putenv.c

    r93 r99  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_putenv.c#6 $
     34 * $P4: //depot/projects/openpam/lib/pam_putenv.c#7 $
    3535 */
    3636
     
    7474        /* grow the environment list if necessary */
    7575        if (pamh->env_count == pamh->env_size) {
    76                 env = realloc(pamh->env, pamh->env_size * 2 + 1);
     76                env = realloc(pamh->env,
     77                    sizeof(char *) * (pamh->env_size * 2 + 1));
    7778                if (env == NULL)
    7879                        return (PAM_BUF_ERR);
Note: See TracChangeset for help on using the changeset viewer.