Should always set the pointer to NULL to avoid corner case on malloc failure
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Jun 2014 15:44:51 +0000 (16:44 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Jun 2014 15:44:51 +0000 (16:44 +0100)
src/main/radsniff.c

index db0d244..39f28eb 100644 (file)
@@ -957,7 +957,7 @@ static inline int rs_request_to_pcap(rs_event_t *event, rs_request_t *request, s
                /* Free the old capture */
                if (request->capture_p->header) {
                        talloc_free(request->capture_p->header);
-                       talloc_free(request->capture_p->data);
+                       TALLOC_FREE(request->capture_p->data);
                }
 
                if (!(request->capture_p->header = talloc(request, struct pcap_pkthdr))) return -1;