Skip to content
Snippets Groups Projects
Commit 7ae96e3f authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'ab/unconditional-free-and-null'

Code clean-up.

* ab/unconditional-free-and-null:
  refactor various if (x) FREE_AND_NULL(x) to just FREE_AND_NULL(x)
parents a988ce9a ce528de0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -337,9 +337,7 @@ static void fill_origin_blob(struct diff_options *opt,
 
static void drop_origin_blob(struct blame_origin *o)
{
if (o->file.ptr) {
FREE_AND_NULL(o->file.ptr);
}
FREE_AND_NULL(o->file.ptr);
}
 
/*
Loading
Loading
Loading
Loading
@@ -25,9 +25,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
tracking->remote = remote->name;
} else {
free(tracking->spec.src);
if (tracking->src) {
FREE_AND_NULL(tracking->src);
}
FREE_AND_NULL(tracking->src);
}
tracking->spec.src = NULL;
}
Loading
Loading
Loading
Loading
@@ -2418,9 +2418,7 @@ void release_http_object_request(struct http_object_request *freq)
close(freq->localfile);
freq->localfile = -1;
}
if (freq->url != NULL) {
FREE_AND_NULL(freq->url);
}
FREE_AND_NULL(freq->url);
if (freq->slot != NULL) {
freq->slot->callback_func = NULL;
freq->slot->callback_data = NULL;
Loading
Loading
Loading
Loading
@@ -557,9 +557,7 @@ struct combine_diff_path *diff_tree_paths(
* free pre-allocated last element, if any
* (see path_appendnew() for details about why)
*/
if (p->next) {
FREE_AND_NULL(p->next);
}
FREE_AND_NULL(p->next);
 
return p;
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment