mirror of
https://github.com/git/git.git
synced 2024-05-09 18:26:08 +02:00
fix null pointer dereference
The malloc function can return null when the memory allocation fails. This commit uses xmalloc to fix it. https://cwe.mitre.org/data/definitions/476.html Signed-off-by: Kleber Tarcísio <klebertarcisio@yahoo.com.br>
This commit is contained in:
parent
a5828ae6b5
commit
8d205037e0
|
@ -1214,7 +1214,7 @@ static void submodule_summary_callback(struct diff_queue_struct *q,
|
|||
|
||||
if (!S_ISGITLINK(p->one->mode) && !S_ISGITLINK(p->two->mode))
|
||||
continue;
|
||||
temp = (struct module_cb*)malloc(sizeof(struct module_cb));
|
||||
temp = (struct module_cb*)xmalloc(sizeof(struct module_cb));
|
||||
temp->mod_src = p->one->mode;
|
||||
temp->mod_dst = p->two->mode;
|
||||
temp->oid_src = p->one->oid;
|
||||
|
|
Loading…
Reference in New Issue