Commit Diff


commit - 23b820a24aee4aff976eee63eff725b3fb44358f
commit + ef68ca6f52da8c840d10d8c483c77fcac614c371
blob - d893d9cfadfcf9aec8b015b5ba0dec0d5eaa887e
blob + 7ac3e89d86dfc8200ca59cddc8111ae2105b4611
--- lib/worktree.c
+++ lib/worktree.c
@@ -989,6 +989,10 @@ install_symlink(struct got_worktree *worktree, const c
 	 */
 	if (!got_path_is_absolute(target_path)) {
 		char *parent = dirname(ondisk_path);
+		if (parent == NULL) {
+			err = got_error_from_errno2("dirname", ondisk_path);
+			goto done;
+		}
 		if (asprintf(&abspath, "%s/%s",  parent, target_path) == -1) {
 			err = got_error_from_errno("asprintf");
 			goto done;