Commit 05ac9784 authored by René Scharfe's avatar René Scharfe Committed by Junio C Hamano

pickaxe: plug diff filespec leak with empty needle

Check first for the unlikely case of an empty needle string and only
then populate the filespec, lest we leak it.
Signed-off-by: default avatarRene Scharfe <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 703f05ad
......@@ -152,10 +152,10 @@ static unsigned int contains(struct diff_filespec *one,
unsigned int cnt;
unsigned long sz;
const char *data;
if (diff_populate_filespec(one, 0))
return 0;
if (!len)
return 0;
if (diff_populate_filespec(one, 0))
return 0;
sz = one->size;
data = one->data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment