commit 61bce19e6ae4329fe5f0a05d33b7bd1510718852 from: Stefan Sperling date: Wed Jun 15 19:19:28 2022 UTC revert "clear the rest of the pack_fds pointers" There is no need to clear local variables before returning from a function. ok tracey commit - 75c1763d9625f6bb8a30952d087f931673ebced6 commit + 61bce19e6ae4329fe5f0a05d33b7bd1510718852 blob - 0f819a2049a5580f75d1892ec62d74882351a417 blob + 98f3281d5becb5173121e9f4f0b74eee3b61bebf --- got/got.c +++ got/got.c @@ -909,7 +909,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (preserve_logmsg) { fprintf(stderr, "%s: log message preserved in %s\n", @@ -1826,7 +1825,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (fetchpid > 0) { if (kill(fetchpid, SIGTERM) == -1) @@ -2653,7 +2651,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &refs, entry) { free((void *)pe->path); @@ -3096,7 +3093,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (head_ref) got_ref_close(head_ref); @@ -3349,7 +3345,6 @@ wrap_not_worktree_error(const struct got_error *orig_e got_repo_pack_fds_close(pack_fds); if (err == NULL) err = pack_err; - pack_fds = NULL; } return err; } @@ -3535,7 +3530,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(worktree_path); TAILQ_FOREACH(pe, &paths, entry) @@ -4546,7 +4540,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (refs_idmap) got_reflist_object_id_map_free(refs_idmap); @@ -5156,7 +5149,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); @@ -5512,7 +5504,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (bca.lines) { for (i = 0; i < bca.nlines; i++) { @@ -5825,7 +5816,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; } @@ -5986,7 +5976,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) @@ -6283,7 +6272,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); free(repo_path); @@ -6723,7 +6711,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); free(repo_path); @@ -7259,7 +7246,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); free(repo_path); @@ -7400,7 +7386,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); @@ -7568,7 +7553,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); @@ -7758,7 +7742,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); return error; @@ -8036,7 +8019,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(path); free(cwd); @@ -8365,7 +8347,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); free(id_str); @@ -8920,7 +8901,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } if (ref) got_ref_close(ref); @@ -9048,7 +9028,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; @@ -9163,7 +9142,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; } @@ -10126,7 +10104,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; } @@ -11514,7 +11491,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; } @@ -11668,7 +11644,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(cwd); free(base_commit_id); @@ -11951,7 +11926,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } return error; } @@ -12112,7 +12086,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); @@ -12237,7 +12210,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); @@ -12600,7 +12572,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } got_ref_list_free(&refs); @@ -12795,7 +12766,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); blob - f516ffc9ef67e92fd5523b7796888ac876576edb blob + d2e712fec877f56e6a3e85c0e93d10cc4ce1a702 --- gotadmin/gotadmin.c +++ gotadmin/gotadmin.c @@ -380,7 +380,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(repo_path); @@ -768,7 +767,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } got_pathlist_free(&exclude_args); got_ref_list_free(&exclude_refs); @@ -862,7 +860,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(id_str); free(pack_hash); @@ -1053,7 +1050,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(id_str); free(pack_hash); @@ -1280,7 +1276,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(repo_path); return error; blob - a529b65f8c23a9d8b11d583f909109a1b9ccec8c blob + 48c3db4951d9e65f17f32a087f88342694e36c1f --- tog/tog.c +++ tog/tog.c @@ -2943,7 +2943,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } tog_free_refs(); return error; @@ -4069,7 +4068,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } tog_free_refs(); return error; @@ -5058,7 +5056,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } tog_free_refs(); return error; @@ -5942,7 +5939,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } tog_free_refs(); return error; @@ -6676,7 +6672,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } tog_free_refs(); return error; @@ -6837,7 +6832,6 @@ done: got_repo_pack_fds_close(pack_fds); if (error == NULL) error = pack_err; - pack_fds = NULL; } free(id); free(commit_id_str);