]> rtime.felk.cvut.cz Git - frescor/forb.git/commitdiff
Fixed allocation of out-direction sequence parameters
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 30 Oct 2008 14:52:47 +0000 (15:52 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 30 Oct 2008 14:52:47 +0000 (15:52 +0100)
forb-idl/forb-idl-c-stubs.c

index 9466c4bca4ab415933b75692e03f70f5264f94c9..dc5c823e3436112e96941750f64915c8223eb57a 100644 (file)
@@ -111,6 +111,7 @@ cs_output_stub (IDL_tree     tree,
                              role == DATA_OUT) { /* Allocate out sequence */
                                  fprintf(ci->fh, "    *%s = forb_malloc(sizeof(**%s));\n", name, name);
                                  fprintf(ci->fh, "    if (!*%s) { ev->major = FORB_EX_NO_MEMORY; goto exception; }\n", name);
+                                 fprintf(ci->fh, "    memset(*%s, 0, sizeof(**%s));\n", name);
                                  /* TODO: Free previously allocated parameters on no memory error. */
                          }
                          fprintf(of, "    ");