From 4e4fe55cfd72b7a8fbc5ef4c7898c360fb8d0b3b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 10 Apr 2010 12:14:42 +0200 Subject: [PATCH] Revert "Fix error introduced when refactoring some of the code." This reverts commit 04730852a0c96baa796ad3f1b52631daaa798977. --- bacula/src/cats/myingres.c | 4 ++-- bacula/src/cats/myingres.sc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bacula/src/cats/myingres.c b/bacula/src/cats/myingres.c index a52e9356d1..42a7fbfd26 100644 --- a/bacula/src/cats/myingres.c +++ b/bacula/src/cats/myingres.c @@ -60,8 +60,8 @@ short INGgetCols(INGconn *dbconn, const char *query, bool transaction) short number = -1; IISQLDA *sqlda; - sqlda = (IISQLDA *)malloc(IISQDA_HEAD_SIZE + IISQDA_VAR_SIZE); - memset(sqlda, 0, (IISQDA_HEAD_SIZE + IISQDA_VAR_SIZE)); + sqlda = (IISQLDA *)malloc(IISQDA_HEAD_SIZE + (number * IISQDA_VAR_SIZE)); + memset(sqlda, 0, (IISQDA_HEAD_SIZE + (number * IISQDA_VAR_SIZE))); sqlda->sqln = number; stmt = bstrdup(query); /* diff --git a/bacula/src/cats/myingres.sc b/bacula/src/cats/myingres.sc index ad19f91359..adebe2e6f0 100644 --- a/bacula/src/cats/myingres.sc +++ b/bacula/src/cats/myingres.sc @@ -57,8 +57,8 @@ short INGgetCols(INGconn *dbconn, const char *query, bool transaction) short number = -1; IISQLDA *sqlda; - sqlda = (IISQLDA *)malloc(IISQDA_HEAD_SIZE + IISQDA_VAR_SIZE); - memset(sqlda, 0, (IISQDA_HEAD_SIZE + IISQDA_VAR_SIZE)); + sqlda = (IISQLDA *)malloc(IISQDA_HEAD_SIZE + (number * IISQDA_VAR_SIZE)); + memset(sqlda, 0, (IISQDA_HEAD_SIZE + (number * IISQDA_VAR_SIZE))); sqlda->sqln = number; -- 2.39.5