aboutsummaryrefslogtreecommitdiff
path: root/src/record.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-22 22:43:18 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-22 22:43:18 +0200
commit3313fc410be0ffabae019de644f041064b054142 (patch)
tree6a88a956a749ff1bac2939c611043b60810e917c /src/record.c
parent50346b1d0fcd69a0be37fc5dfd2f5ec65ae58c28 (diff)
downloaddns-3313fc410be0ffabae019de644f041064b054142.tar.gz
record/zonefile: malloc checks
Diffstat (limited to 'src/record.c')
-rw-r--r--src/record.c4
1 files changed, 3 insertions, 1 deletions
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 )