]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_lpm/rte_lpm6.c
lpm6: fix use after free
[dpdk.git] / lib / librte_lpm / rte_lpm6.c
index eded7725e800358716cc525db079755bd1d5c3a0..4c44cd754192bb7764ae1a61d54df67572bc0b6c 100644 (file)
@@ -206,8 +206,9 @@ rte_lpm6_create(const char *name, int socket_id,
                        (size_t)rules_size, RTE_CACHE_LINE_SIZE, socket_id);
 
        if (lpm->rules_tbl == NULL) {
-               RTE_LOG(ERR, LPM, "LPM memory allocation failed\n");
+               RTE_LOG(ERR, LPM, "LPM rules_tbl allocation failed\n");
                rte_free(lpm);
+               lpm = NULL;
                rte_free(te);
                goto exit;
        }