]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
freeing memory is good, too
authorAlan T. DeKok <aland@freeradius.org>
Tue, 14 Feb 2017 16:31:54 +0000 (11:31 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 14 Feb 2017 16:31:54 +0000 (11:31 -0500)
src/main/unit_test_attribute.c

index a677555c40fb601f37cf34f075093b5d537d5e9e..ffc6de2c53a1ba222253cb880637b7862f2fc218 100644 (file)
@@ -907,12 +907,14 @@ static void process_file(fr_dict_t *dict, const char *root_dir, char const *file
 
                        if (fr_pair_list_afrom_str(packet, p, &head) != T_EOL) {
                                strlcpy(output, fr_strerror(), sizeof(output));
+                               talloc_free(packet);
                                continue;
                        }
 
                        packet->vps = head;
                        if (tacacs_encode(packet, NULL) < 0) {
                                strlcpy(output, fr_strerror(), sizeof(output));
+                               talloc_free(packet);
                                continue;
                        }
 
@@ -948,6 +950,7 @@ static void process_file(fr_dict_t *dict, const char *root_dir, char const *file
 
                        if (tacacs_decode(packet) < 0) {
                                strlcpy(output, fr_strerror(), sizeof(output));
+                               talloc_free(packet);
                                continue;
                        }
 
@@ -964,7 +967,6 @@ static void process_file(fr_dict_t *dict, const char *root_dir, char const *file
                        }
 
                        talloc_free(packet);
-
                        continue;
                }
 #endif /* WITH_TACACS */