[BACK]Return to alloc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/alloc.c between version 1.2.4.1 and 1.3

version 1.2.4.1, 2002/01/18 17:20:22 version 1.3, 2002/01/03 03:49:16
Line 1 
Line 1 
 /*  /*
  * Copyright (c) 1999-2002 Todd C. Miller <Todd.Miller@courtesan.com>   * Copyright (c) 1999-2001 Todd C. Miller <Todd.Miller@courtesan.com>
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 58 
Line 58 
   
 #include "sudo.h"  #include "sudo.h"
   
   #ifndef STDC_HEADERS
   #if !defined(__GNUC__) && !defined(HAVE_MALLOC_H)
   extern VOID *malloc     __P((size_t));
   #endif /* !__GNUC__ && !HAVE_MALLOC_H */
   #endif /* !STDC_HEADERS */
   
   extern char **Argv;             /* from sudo.c */
   
 #ifndef lint  #ifndef lint
 static const char rcsid[] = "$Sudo: alloc.c,v 1.11 2002/01/09 16:56:04 millert Exp $";  static const char rcsid[] = "$Sudo: alloc.c,v 1.10 2001/12/14 19:52:47 millert Exp $";
 #endif /* lint */  #endif /* lint */
   
 extern char **Argv;             /* from sudo.c */  
   
 /*  /*
  * emalloc() calls the system malloc(3) and exits with an error if   * emalloc() calls the system malloc(3) and exits with an error if
Line 74 
Line 81 
 {  {
     VOID *ptr;      VOID *ptr;
   
     if ((ptr = (VOID *) malloc(size)) == NULL) {      if ((ptr = malloc(size)) == NULL) {
         (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);          (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
         exit(1);          exit(1);
     }      }
Line 92 
Line 99 
     size_t size;      size_t size;
 {  {
   
     ptr = ptr ? (VOID *) realloc(ptr, size) : (VOID *) malloc(size);      if ((ptr = ptr ? realloc(ptr, size) : malloc(size)) == NULL) {
     if (ptr == NULL) {  
         (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);          (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
         exit(1);          exit(1);
     }      }

Legend:
Removed from v.1.2.4.1  
changed lines
  Added in v.1.3