kvm_proc.c (38534) | kvm_proc.c (39327) |
---|---|
1/*- 2 * Copyright (c) 1989, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software developed by the Computer Systems 6 * Engineering group at Lawrence Berkeley Laboratory under DARPA contract 7 * BG 91-66 and contributed to Berkeley. 8 * --- 356 unchanged lines hidden (view full) --- 365void * 366_kvm_realloc(kd, p, n) 367 kvm_t *kd; 368 void *p; 369 size_t n; 370{ 371 void *np = (void *)realloc(p, n); 372 | 1/*- 2 * Copyright (c) 1989, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software developed by the Computer Systems 6 * Engineering group at Lawrence Berkeley Laboratory under DARPA contract 7 * BG 91-66 and contributed to Berkeley. 8 * --- 356 unchanged lines hidden (view full) --- 365void * 366_kvm_realloc(kd, p, n) 367 kvm_t *kd; 368 void *p; 369 size_t n; 370{ 371 void *np = (void *)realloc(p, n); 372 |
373 if (np == 0) | 373 if (np == 0) { 374 free(p); |
374 _kvm_err(kd, kd->program, "out of memory"); | 375 _kvm_err(kd, kd->program, "out of memory"); |
376 } |
|
375 return (np); 376} 377 378#ifndef MAX 379#define MAX(a, b) ((a) > (b) ? (a) : (b)) 380#endif 381 382/* --- 351 unchanged lines hidden --- | 377 return (np); 378} 379 380#ifndef MAX 381#define MAX(a, b) ((a) > (b) ? (a) : (b)) 382#endif 383 384/* --- 351 unchanged lines hidden --- |