Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
05848a2
)
fix realloc call for systems that don't handle realloc(NULL, ...)
author
Andrew Tridgell
<tridge@samba.org>
Thu, 28 May 1998 06:29:57 +0000
(06:29 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 28 May 1998 06:29:57 +0000
(06:29 +0000)
loadparm.c
patch
|
blob
|
blame
|
history
diff --git
a/loadparm.c
b/loadparm.c
index
a302f46
..
0ddbc61
100644
(file)
--- a/
loadparm.c
+++ b/
loadparm.c
@@
-47,7
+47,6
@@
#define BOOL int
#define False 0
#define True 1
#define BOOL int
#define False 0
#define True 1
-#define Realloc realloc
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2)))
#define strequal(a,b) (strcasecmp(a,b)==0)
#define BOOLSTR(b) ((b) ? "Yes" : "No")
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2)))
#define strequal(a,b) (strcasecmp(a,b)==0)
#define BOOLSTR(b) ((b) ? "Yes" : "No")
@@
-367,7
+366,13
@@
static int add_a_service(service *pservice, char *name)
i = iNumServices;
i = iNumServices;
- ServicePtrs = (service **)Realloc(ServicePtrs,sizeof(service *)*num_to_alloc);
+ if (ServicePtrs) {
+ ServicePtrs = (service **)realloc(ServicePtrs,
+ sizeof(service *)*num_to_alloc);
+ } else {
+ ServicePtrs = (service **)malloc(sizeof(service *)*num_to_alloc);
+ }
+
if (ServicePtrs)
pSERVICE(iNumServices) = (service *)malloc(sizeof(service));
if (ServicePtrs)
pSERVICE(iNumServices) = (service *)malloc(sizeof(service));