Skip to content

Commit

Permalink
fix #3 'no talloc stackframe'
Browse files Browse the repository at this point in the history
  • Loading branch information
kolyvan committed Jun 21, 2013
1 parent 8aa3cbe commit 82abf0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions KxSMBProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

#import "KxSMBProvider.h"
#import "libsmbclient.h"
#import "talloc_stack.h"

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -267,7 +268,12 @@ + (SMBCCTX *) openSmbContext
+ (void) closeSmbContext: (SMBCCTX *) smbContext
{
if (smbContext) {

// fixes warning: no talloc stackframe at libsmb/cliconnect.c:2637, leaking memory
TALLOC_CTX *frame = talloc_stackframe();
smbc_getFunctionPurgeCachedServers(smbContext)(smbContext);
TALLOC_FREE(frame);

smbc_free_context(smbContext, NO);
}
}
Expand Down
8 changes: 8 additions & 0 deletions KxSMBSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
87085FC81705D4FD009CD258 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
87085FCA1705D503009CD258 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
87085FCC1705D509009CD258 /* libresolv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libresolv.dylib; path = usr/lib/libresolv.dylib; sourceTree = SDKROOT; };
871CC5581774489A00EDD76D /* talloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = talloc.h; path = libs/talloc.h; sourceTree = "<group>"; };
871CC5591774491A00EDD76D /* talloc_stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = talloc_stack.h; path = libs/talloc_stack.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -148,6 +150,8 @@
87085FBE1705D4BE009CD258 /* libs */ = {
isa = PBXGroup;
children = (
871CC5591774491A00EDD76D /* talloc_stack.h */,
871CC5581774489A00EDD76D /* talloc.h */,
87085FC01705D4CA009CD258 /* libsmbclient.h */,
87085FBF1705D4CA009CD258 /* libsmbclient.a */,
87085FC11705D4CA009CD258 /* libtalloc.a */,
Expand Down Expand Up @@ -308,13 +312,15 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KxSMBSample/KxSMBSample-Prefix.pch";
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libs\"";
INFOPLIST_FILE = "KxSMBSample/KxSMBSample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libs\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -324,13 +330,15 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KxSMBSample/KxSMBSample-Prefix.pch";
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libs\"";
INFOPLIST_FILE = "KxSMBSample/KxSMBSample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libs\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ end
desc "Copy smb headers"
task :copy_headers do
copyIfNotExists('libsmbclient.h', "#{SAMBA_SOURCE_PATH}/include/", 'libs')
copyIfNotExists('talloc.h', "#{SAMBA_FOLDER}/lib/talloc/", 'libs')
copyIfNotExists('talloc_stack.h', "#{SAMBA_FOLDER}/lib/util/", 'libs')
end

desc "Copy smb libs"
Expand Down

0 comments on commit 82abf0a

Please sign in to comment.