possible memleak
authorMiloš Mulač <mulac@civ.zcu.cz>
Thu, 28 Feb 2008 14:25:58 +0000 (14:25 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Thu, 28 Feb 2008 14:25:58 +0000 (14:25 +0000)
org.glite.lbjp-common.db/src/db.c

index 188e6a9..66816a1 100644 (file)
@@ -426,7 +426,7 @@ int glite_lbu_QueryIndices(glite_lbu_DBContext ctx, const char *table, char ***k
                idx[i][j] = strdup(showcol[Column_name]);
 //printf("****** [%d, %d] %s\n", i, j, idx[i][j]);
 //FIXME: needed?idx[i][j].value.i = atoi(showcol[Sub_part]);
-               for (i = 0; showcol[i]; i++) free(showcol[i]);
+               for (i = 0; i<(sizeof(showcol)/sizeof(showcol[0])); i++) free(showcol[i]);
        }
 
        glite_lbu_FreeStmt(&stmt);