X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Fcollect%2Fcollect.c;h=3a7e826e4dfd0ce80b914cdfd0196d1cb66ce529;hp=355b85b5cfdb6199c63caa95bb1c5acf3b1d33a9;hb=10b2d011e70ddf9361c61f6147dc88f670d28abd;hpb=002a957762969c32907f55586b2b2cefe8555732 diff --git a/extras/collect/collect.c b/extras/collect/collect.c index 355b85b5c..3a7e826e4 100644 --- a/extras/collect/collect.c +++ b/extras/collect/collect.c @@ -171,8 +171,7 @@ static int checkout(int fd) if (debug) fprintf(stderr, "Found word %s\n", word); him = malloc(sizeof (struct _mate)); - him->name = malloc(strlen(word) + 1); - strcpy(him->name, word); + him->name = strdup(word); him->state = STATE_OLD; udev_list_node_append(&him->node, &bunch); word = NULL;