mirror of https://gerrit.osmocom.org/asn1c
reverted to strdup() back
This commit is contained in:
parent
fcd688af1f
commit
b1107e6ac2
|
@ -447,8 +447,8 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-rm -f asn1p_y.c
|
||||
-rm -f asn1p_l.c
|
||||
-rm -f asn1p_y.c
|
||||
-rm -f asn1p_y.h
|
||||
clean: clean-am
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <assert.h>
|
||||
|
@ -181,12 +181,10 @@ _asn1p_fix_modules(asn1p_t *a, const char *fname) {
|
|||
asn1p_module_t *mod;
|
||||
TQ_FOR(mod, &(a->modules), mod_next) {
|
||||
asn1p_expr_t *expr;
|
||||
int flen = strlen(fname) + 1;
|
||||
|
||||
mod->source_file_name = malloc(flen);
|
||||
mod->source_file_name = strdup(fname);
|
||||
if(mod->source_file_name == NULL)
|
||||
return -1;
|
||||
memcpy(mod->source_file_name, fname, flen);
|
||||
|
||||
TQ_FOR(expr, &(mod->members), next) {
|
||||
_asn1p_apply_module2expr(expr, mod);
|
||||
|
|
Loading…
Reference in New Issue