avoid new gcc warnings for assigning the lvalue

diff --git a/skeletons/asn_codecs_prim.c b/skeletons/asn_codecs_prim.c
index f2d045a..03f107b 100644
--- a/skeletons/asn_codecs_prim.c
+++ b/skeletons/asn_codecs_prim.c
@@ -22,12 +22,13 @@
 	 * If the structure is not there, allocate it.
 	 */
 	if(st == NULL) {
-		(void *)st = *sptr = CALLOC(1, sizeof(*st));
+		st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st));
 		if(st == NULL) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
 			return rval;
 		}
+		*sptr = (void *)st;
 	}
 
 	ASN_DEBUG("Decoding %s as plain primitive (tm=%d)",