X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flists.c;h=5c6c52c4c9b2c9f15a4bdddcd05bef422125b929;hp=45a4874b6e94f268aa2a0942cdf249c4aec12a24;hb=33fae67579eeab31d7f96f9e53f0529f584b0b1f;hpb=8ec17063a6e651229e04605592ce3d6114075655 diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c index 45a4874b..5c6c52c4 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -147,11 +147,8 @@ Lists_Add(struct list_head *h, const char *Mask, time_t ValidUntil, strlcpy(newelem->mask, Mask, sizeof(newelem->mask)); if (Reason) { - newelem->reason = malloc(strlen(Reason) + 1); - if (newelem->reason) - strlcpy(newelem->reason, Reason, - sizeof(newelem->reason)); - else + newelem->reason = strdup(Reason); + if (!newelem->reason) Log(LOG_EMERG, "Can't allocate memory for new list reason text!"); }