1 --- rdist-6.1.5/src/client.c.links Wed Feb 17 17:46:09 1999
2 +++ rdist-6.1.5/src/client.c Wed Feb 17 17:51:15 1999
20 * Save and retrieve hard link info
26 + /* xxx: linear search doesn't scale with many links */
27 for (lp = ihead; lp != NULL; lp = lp->nextp)
28 if (lp->inum == statp->st_ino && lp->devnum == statp->st_dev) {
31 lp->inum = statp->st_ino;
32 lp->devnum = statp->st_dev;
33 lp->count = statp->st_nlink - 1;
34 - (void) strcpy(lp->pathname, target);
35 - (void) strcpy(lp->src, source);
36 + lp->pathname = strdup(target);
37 + lp->src = strdup(source);
39 - (void) strcpy(lp->target, Tdest);
40 + lp->target = strdup(Tdest);
42 - *lp->target = CNULL;
44 + if (!lp->pathname || !lp->src || !(Tdest && lp->target))
45 + fatalerr("Cannot malloc memory in linkinfo.");
47 return((struct linkbuf *) NULL);
49 --- rdist-6.1.5/src/docmd.c.links Wed Feb 17 17:51:23 1999
50 +++ rdist-6.1.5/src/docmd.c Wed Feb 17 17:52:44 1999
53 register struct linkbuf *nextl, *l;
55 - for (l = ihead; l != NULL; free((char *)l), l = nextl) {
56 + for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) {
58 if (contimedout || IS_ON(opts, DO_IGNLNKS) ||
60 --- rdist-6.1.5/include/defs.h.links Wed Feb 17 17:52:58 1999
61 +++ rdist-6.1.5/include/defs.h Wed Feb 17 17:53:47 1999
66 - char pathname[BUFSIZ];
68 - char target[BUFSIZ];
72 struct linkbuf *nextp;