Fix a minor memory leak
authorWouter Verhelst <w@uter.be>
Sat, 26 May 2012 07:09:27 +0000 (09:09 +0200)
committerWouter Verhelst <w@uter.be>
Sat, 26 May 2012 07:09:27 +0000 (09:09 +0200)
The 'next' label does some cleanup, so jump there rather than to the
start of the loop.

nbd-server.c

index a8f4f401a9f536f91b2ee34ca54409bca9b3dedb..4f5e3b6c6fd5e01db1b330998695f8360290614a 100644 (file)
@@ -803,7 +803,7 @@ GArray* do_cfile_dir(gchar* dir, GError** e) {
                        case DT_REG:
                                /* Skip unless the name ends with '.conf' */
                                if(strcmp((de->d_name + strlen(de->d_name) - 5), ".conf")) {
-                                       continue;
+                                       goto next;
                                }
                                tmp = parse_cfile(fname, FALSE, e);
                                errno=saved_errno;