aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/descriptor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/descriptor.c')
-rw-r--r--src/interfaces/ecpg/preproc/descriptor.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c
index 9b87d07d09f..e8c7016bdc1 100644
--- a/src/interfaces/ecpg/preproc/descriptor.c
+++ b/src/interfaces/ecpg/preproc/descriptor.c
@@ -344,11 +344,17 @@ descriptor_variable(const char *name, int input)
struct variable *
sqlda_variable(const char *name)
{
- struct variable *p = (struct variable *) mm_alloc(sizeof(struct variable));
-
- p->name = mm_strdup(name);
- p->type = (struct ECPGtype *) mm_alloc(sizeof(struct ECPGtype));
+ /*
+ * Presently, sqlda variables are only needed for the duration of the
+ * current statement. Rather than add infrastructure to manage them,
+ * let's just loc_alloc them.
+ */
+ struct variable *p = (struct variable *) loc_alloc(sizeof(struct variable));
+
+ p->name = loc_strdup(name);
+ p->type = (struct ECPGtype *) loc_alloc(sizeof(struct ECPGtype));
p->type->type = ECPGt_sqlda;
+ p->type->type_name = NULL;
p->type->size = NULL;
p->type->struct_sizeof = NULL;
p->type->u.element = NULL;