]> git.ipfire.org Git - pakfire.git/commitdiff
solutions: Initialize elements
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2024 15:47:41 +0000 (15:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2024 15:47:41 +0000 (15:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/solution.c

index ba676cb398fb7acd537bc68dacfdf016d75858e0..cc69e3a7bcaba8f233eee03c33e77a301700e7e9 100644 (file)
@@ -118,6 +118,10 @@ static char* pakfire_solution_make_string(struct pakfire_solution* solution) {
        // Allocate memory for all strings
        char* elements[count + 1];
 
+       // Initialize elements
+       for (unsigned int i = 0; i < count + 1; i++)
+               elements[i] = NULL;
+
        // The result string
        char* s = NULL;