Hi, well, not much explanation necessary, I think. You guessed it: it's untested. Florian diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index 54ea328..64203a8 100644 --- a/libudev/libudev-util-private.c +++ b/libudev/libudev-util-private.c @@ -157,7 +157,7 @@ gid_t util_lookup_group(struct udev *udev, const char *group) { char *endptr; int buflen; - char *buf; + char *buf,*newbuf; struct group grbuf; struct group *gr; gid_t gid = 0; @@ -174,9 +174,10 @@ gid_t util_lookup_group(struct udev *udev, const char *group) buf = NULL; gid = 0; for (;;) { - buf = realloc(buf, buflen); - if (!buf) + newbuf = realloc(buf, buflen); + if (!newbuf) break; + buf = newbuf; errno = 0; getgrnam_r(group, &grbuf, buf, buflen, &gr); if (gr != NULL) -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html