changeset 1595:34251a0d774e

fix dpid line leak
author corvid <corvid@lavabit.com>
date Mon, 01 Mar 2010 02:46:04 +0000
parents f27e5fed2e6b
children c4502225d4de
files dpid/dpid.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dpid/dpid.c	Sat Feb 27 17:28:37 2010 +0100
+++ b/dpid/dpid.c	Mon Mar 01 02:46:04 2010 +0000
@@ -468,7 +468,7 @@
    *services_list = dList_new(8);
 
    /* dpidrc parser loop */
-   while ((line = dGetline(dpidrc_stream)) != NULL) {
+   for (;(line = dGetline(dpidrc_stream)) != NULL; dFree(line)) {
       st = dParser_parse_rc_line(&line, &service, &path);
       if (st < 0) {
          MSG_ERR("dpid: Syntax error in %s: service=\"%s\" path=\"%s\"\n",
@@ -498,8 +498,6 @@
       /* if the dpi exist bind service and dpi */
       if (i < numdpis)
          s->dp_index = i;
-
-      dFree(line);
    }
    fclose(dpidrc_stream);