diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-30 12:01:27 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-30 12:01:27 +0200 |
commit | dd68d665e140970c7d9dfd899fbdd4fefacb54a7 (patch) | |
tree | b768c8779212e660f81f77b9fbdaba0c8448c4c0 | |
parent | bc458ee7949e01e0b5a1f7f15773c02be94cb8fa (diff) | |
download | gnunet-dd68d665e140970c7d9dfd899fbdd4fefacb54a7.tar.gz gnunet-dd68d665e140970c7d9dfd899fbdd4fefacb54a7.zip |
fix memory leak
-rw-r--r-- | src/namestore/gnunet-zoneimport.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index 6c89cdb05..ddc8b483a 100644 --- a/src/namestore/gnunet-zoneimport.c +++ b/src/namestore/gnunet-zoneimport.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
@@ -456,6 +456,7 @@ build_dns_query (struct Request *req, | |||
456 | char *rawp; | 456 | char *rawp; |
457 | struct GNUNET_DNSPARSER_Packet p; | 457 | struct GNUNET_DNSPARSER_Packet p; |
458 | struct GNUNET_DNSPARSER_Query q; | 458 | struct GNUNET_DNSPARSER_Query q; |
459 | int ret; | ||
459 | 460 | ||
460 | q.name = (char *) req->hostname; | 461 | q.name = (char *) req->hostname; |
461 | q.type = GNUNET_DNSPARSER_TYPE_NS; | 462 | q.type = GNUNET_DNSPARSER_TYPE_NS; |
@@ -467,12 +468,14 @@ build_dns_query (struct Request *req, | |||
467 | p.num_queries = 1; | 468 | p.num_queries = 1; |
468 | p.queries = &q; | 469 | p.queries = &q; |
469 | p.id = req->id; | 470 | p.id = req->id; |
470 | if (GNUNET_OK != | 471 | ret = GNUNET_DNSPARSER_pack (&p, |
471 | GNUNET_DNSPARSER_pack (&p, | 472 | UINT16_MAX, |
472 | UINT16_MAX, | 473 | &rawp, |
473 | &rawp, | 474 | raw_size); |
474 | raw_size)) | 475 | if (GNUNET_OK != ret) |
475 | { | 476 | { |
477 | if (GNUNET_NO == ret) | ||
478 | GNUNET_free (rawp); | ||
476 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 479 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
477 | "Failed to pack query for hostname `%s'\n", | 480 | "Failed to pack query for hostname `%s'\n", |
478 | req->hostname); | 481 | req->hostname); |