]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Sanity Checking for malloc
authorBill Parker <[email protected]>
Tue, 4 Sep 2012 17:04:17 +0000 (10:04 -0700)
committerMichael Richardson <[email protected]>
Wed, 5 Sep 2012 00:45:28 +0000 (20:45 -0400)
Added sanity checking for return value to filename being equal to NULL

Conflicts:
tcpdump.c

tcpdump.c

index 41f952f2320ace011497940c1a735b8a6639049c..6f12adc495ea919bead68699bf13f74f3c8b72ce 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -589,8 +589,8 @@ static void
 MakeFilename(char *buffer, char *orig_name, int cnt, int max_chars)
 {
         char *filename = malloc(NAME_MAX + 1);
-       if (filename == NULL)   /* didn't get memory requested  */
-        error("malloc of filename:");
+       if (filename == NULL)
+               error("Makefilename: malloc);
 
         /* Process with strftime if Gflag is set. */
         if (Gflag != 0) {