From 3313fc410be0ffabae019de644f041064b054142 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Wed, 22 Sep 2021 22:43:18 +0200 Subject: record/zonefile: malloc checks --- src/record.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/record.c') diff --git a/src/record.c b/src/record.c index e323718..e6e70dc 100644 --- a/src/record.c +++ b/src/record.c @@ -155,11 +155,13 @@ static ssize_t record_rdata_a(char* _str, void** _rdata) { len = strlen(_str) + 1; str = malloc(len); + if ( !str ) + return -1; strncpy(str, _str, len); *_rdata = malloc(4); if ( !*_rdata ) - return -1; + goto err; tok = strtok(str, "."); if( !tok ) -- cgit v1.2.3