- static Z_APDU apdu;
- static Z_SearchResponse resp;
- static int nulint = 0;
- static bool_t sr = 1;
- static int next = 0;
- static int none = Z_RES_NONE;
-
- apdu.which = Z_APDU_searchResponse;
- apdu.u.searchResponse = &resp;
- resp.referenceId = req->referenceId;
-#ifdef Z_95
- resp.additionalSearchInfo = 0;
- resp.otherInfo = 0;
-#endif
+ Z_APDU *apdu = odr_malloc (assoc->encode, sizeof(*apdu));
+ Z_SearchResponse *resp = odr_malloc (assoc->encode, sizeof(*resp));
+ int *nulint = odr_malloc (assoc->encode, sizeof(*nulint));
+ bool_t *sr = odr_malloc (assoc->encode, sizeof(*sr));
+ int *next = odr_malloc (assoc->encode, sizeof(*next));
+ int *none = odr_malloc (assoc->encode, sizeof(*none));
+
+ *nulint = 0;
+ *sr = 1;
+ *next = 0;
+ *none = Z_RES_NONE;
+
+ apdu->which = Z_APDU_searchResponse;
+ apdu->u.searchResponse = resp;
+ resp->referenceId = req->referenceId;
+ resp->additionalSearchInfo = 0;
+ resp->otherInfo = 0;