empty strings
diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c
index 16d3a89..89d5de0 100644
--- a/skeletons/OCTET_STRING.c
+++ b/skeletons/OCTET_STRING.c
@@ -1109,9 +1109,12 @@
* Create the string if does not exist.
*/
if(!*sptr) {
- *sptr = CALLOC(1, specs->struct_size);
- if(*sptr == NULL) {
+ OCTET_STRING_t *st;
+ (void *)st = *sptr = CALLOC(1, specs->struct_size);
+ if(st) st->buf = (uint8_t *)CALLOC(1, 1);
+ if(!*sptr || !st->buf) {
asn_dec_rval_t rval;
+ if(*sptr) FREEMEM(*sptr);
rval.code = RC_FAIL;
rval.consumed = 0;
return rval;