Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Only allocate the needed memory
Baptiste Daroussin committed 12 years ago
commit 1ae68c0b1b471acc191f08052deda966be8b5bfb
parent dc88d4a53a8a5831ff8debac283885327ba8341a
1 file changed +1 -1
modified libpkg/dns_utils.c
@@ -68,7 +68,7 @@ compute_weight(struct dns_srvinfo **d, int first, int last)
{
	int i, j;
	int totalweight = 0;
-
	int *chosen = malloc(sizeof(int) * last - first + 1);
+
	int *chosen = malloc(sizeof(int) * (last - first + 1));

	for (i = 0; i <= last; i++)
		totalweight += d[i]->weight;