commit 9f42ff692bc2cb443e1aa112484d293022ce3a30 from: Stefan Sperling date: Mon May 13 15:15:16 2019 UTC check malloc failure in collect_commit_logmsg() commit - 19332e6de6ff3f51e60c6e32716235833b2c6085 commit + 9f42ff692bc2cb443e1aa112484d293022ce3a30 blob - 33f2e988a9bca9de9b8ab6bc7986acae6cb956fe blob + fd76c1551b254d17ac5f497c18317b74d445b335 --- got/got.c +++ got/got.c @@ -2201,6 +2201,8 @@ collect_commit_logmsg(struct got_pathlist_head *commit if (cmdline_log != NULL && strlen(cmdline_log) != 0) { len = strlen(cmdline_log) + 1; *logmsg = malloc(len + 1); + if (*logmsg == NULL) + return got_error_prefix_errno("malloc"); strlcpy(*logmsg, cmdline_log, len); return NULL; }