From: Junio C Hamano Date: Fri, 12 Aug 2016 18:11:08 GMT Subject: Re: [PATCH v12 11/13] bisect--helper: `bisect_next_check` & bisect_voc shell function in C Message-ID: In-Reply-To: <010201567675ae68-15d79b9a-83fc-44ee-8607-07c2d0191c59-000000@eu-west-1.amazonses.com> Pranit Bauva writes: > +static char *bisect_voc(char *revision_type) > +{ > + if (!strcmp(revision_type, "bad")) > + return "bad|new"; > + if (!strcmp(revision_type, "good")) > + return "good|old"; > + > + return NULL; > +} I think you can return "const char *" from the above function. Then you do not have to do xstrdup() on the return values to store in bad_syn and good_syn, and you do not have to free(3) them. > +static int bisect_next_check(const struct bisect_terms *terms, > + const char *current_term) > +{ > + .... > + fprintf(stderr, N_("Warning: bisecting only with a %s commit\n"), > + terms->term_bad.buf); Hmph, is this N_() and not _()? > + .... > + } > + bad_syn = xstrdup(bisect_voc("bad")); > + good_syn = xstrdup(bisect_voc("good")); > + .... > + free(bad_syn); > + free(good_syn);